Page 1 of 1

update to subpresentable re-fetches main presentable

Posted: Tue Dec 18, 2012 11:57 am
by matthew.walters
Hi,

I have account and transaction entites with account having many transactions.
I have a page for accounts where you can see the transactions (createBasedListStructurePresenter).
The account has a field for total $ amount.
I've implemented functionality to create a new transaction associated with the account, and have it update the total amount of the account.
I've done that using a custom persistencehandler for creating a transaction (creates a new transaction in the database and updates the $ amount on the account)

The only issue I'm having is after creating the transaction, the account's $ amount that is displayed is not updated to reflect the new transaction (but is updated in the DB); I have to reload the accounts section and then reload the specific account to get the current value.
Is there anyway to set it so that the main presentable gets refreshed when a new entity of the subpresentable is created?

Thanks

Re: update to subpresentable re-fetches main presentable

Posted: Fri Dec 21, 2012 5:08 pm
by phillipuniverse
You could try invalidating the cache of that list. So from a presenter just get a handle to the grid that you want to refresh like:

Code: Select all


display
.getListDisplay().getGrid().invalidateCache().
 


You could put that in a callback handler of the subpresenter that you need to; check the bind() method of your specific subpresenter to see what we're using already.