Update a model/table in a different component

I have a complex page, with a table component showing a list of Accounts from a Model.

There is also button which launches a pop up titled "New Account"

This button shows a pop up component, and in that component is a Skuid Page Include.

The Page Include is for an account form (which is used in multiple places, hence creating it once and using includes to place it throughout the app).

When the pop-up is completed and the New Account record saved (from a model in the Account Form component)… I need the page “below” from whence it came to reload the Account list with this new one in it.

Trouble is I can’t work out how to do this!! The actual Account Form component is a separate page from the one with the table on it, so I don’t have the model in the lists under actions etc.

I believe I either need to:

1) Trigger the re-query of the table from the account form/popup closing, this sounds perfect, except how do I re-query the model in one component from another?

2) Pass the new account model back down to the page somehow in the Save actions from the Account Form.

3) Somehow pass the (empty) model reference UP from the page into the Account Form and then I can write an action to re-query the table when it is modified by the saving process.

Can I stick an action on the pop-up being closed on the table page? That would indicate that (potentially) the data had changed and I can requery my model.

Can I put a “watch” on the model behind the table to notice a new Account has been inserted (sounds wild, but I wouldn’t put it past Skuid!)

If the Account form was directly on the Page with the table, this would be a piece of cake right. As soon as the form was saved, I can use that action to requery the model in the table, but the problem is the model and the table isn’t in the form component.

There may be other options, I’m open to all ideas! Cheers.

Ah ha! I found the “After Close Actions” on the pop-up. A new one to me; brilliant!

So I can force the re-query of the table model when the pop-up is closed, so I have functional completeness.

I am something of an architect, and don’t revel in the fact that this component will requery the whole table model whether the data has changed or not (ie. someone could open, and close the pop-up without making a new account), which seems wasteful.

I would prefer to pass the Account back to jam it in the list myself (all through the page state would be lovely) or at least only refresh the table on insert of the Account model - if anyone has any tips on that. Otherwise, I will live with the After Close Actions for now :slight_smile: