I’ve been trying to figure out how to do this when my repeating panel is in 1 form and that uses a seperate FormTemplate and lets say I have a button in this form template and when people click it, it asks for confirmation and deletes the record (this part works).
But if I want to then refresh the table that has the records in it I cannot because all that reload logic and such all exists in my other form and even importing it and trying to call reload on it doesn’t change anything.
Any suggestions here? Let me know if I need to clarify anything.
I’m familiar with these ways was more curious how to do it when my button is inside the template itself I’ll re-read it and see if there is anything in there about this, thanks again I might have missed it
Since I’m using the Material UI setup and using the dashboard concept and since this is a template file not a real form the only way I know how to technically refresh the repeating panel that is on a different form than where this template is obviously is by basically having it act like we re-clicked the Feeding link which would refresh the page.
I’m open to ideas on how to refresh a repeating panel from a template that doesn’t know anything about said repeating panel that is on a different form.
I had to do something similar when i componentized my outline. Some of the buttons in the outline had to call event-handler functions that were not in the outline structure itself.
In my case, I passed the handler (defined elsewhere) to the outline constructor. In other cases, your code has to perform two steps:
find the button(s)
(re)set its handler to whatever function you want.
Importantly, the code that does this does not have to be in any particular place. Neither does the handler code. It could be in the main form, in the other template/form, etc.
What I do in a similar situation (just deleted a record from inside a repeating panel, need to reload the items), is this (where the server call has all the logic in it to get the items):
The parent of the repeating panel item template is the repeating panel itself. If you need to do something with the container the repeating panel is in, add a parent to the chain:
self.parent.parent.raise_event('x-show-page')
You can keep chaining parents, but then the code becomes very sensitive to the nesting layers of your forms.
Edit: I think get_open_form () is best if what you’re doing is completely replacing the contents of a panel, to navigate to a new page for example.