I have an AdminForm showing a list of items. The items may be filtered from elements in a filter bar.
I have a toolbar (popup) button which I want to take that list, including any filters set, and show the data in a modal dialog.
I can do all of that except re-create/use the filters, I just get the full list. The popup button calls a method in the controller that
How can I regenerate the model state. It's clearly there somewhere since re-displaying the page (from the menu) re-applies the correct filters.
I looked at "getState()", but the new call finds __state_set has the value true, which prevents the previous state from being recalled, but it's a protected variable...
Ok, that gives me a clue as how to do this. I've made a method in the model called "cheat" which I call to then reset the protected variable and call getState. That works, but surely isn't a good way to do it. What's the right way?
I have a toolbar (popup) button which I want to take that list, including any filters set, and show the data in a modal dialog.
I can do all of that except re-create/use the filters, I just get the full list. The popup button calls a method in the controller that
How can I regenerate the model state. It's clearly there somewhere since re-displaying the page (from the menu) re-applies the correct filters.
I looked at "getState()", but the new call finds __state_set has the value true, which prevents the previous state from being recalled, but it's a protected variable...
Ok, that gives me a clue as how to do this. I've made a method in the model called "cheat" which I call to then reset the protected variable and call getState. That works, but surely isn't a good way to do it. What's the right way?
Statistics: Posted by MarkRS — Tue Apr 23, 2024 4:49 pm