Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Reloading specific tab or entire page from popup level


Reply


864 Views

Avatar
k0m0r

Community Member, 39 Posts

8 October 2010 at 11:08pm

Hi.
This is a cross-post from the DOM forum, but I realized it's not really a matter of DOM.

I have a DataObject, that creates another object and deletes itself in onAfterWrite().
I bumped into two issues:
1. As the new object is added to another tab, this tab is not being refreshed and the created object is not shown until page/tab reload.
2. After saving DataObject, the popup reloads and tries to load data of the object that no longer exists, so it ends up with error.

The easiest solution would be to just reload the entire page in onAfterWrite(). But LeftAndMain::ForceReload() does not work from inside a popup. Is there a way to achieve this?

If this cannot be done, I would like to:
1. Refresh a specific tab at currently opened page (by its name), or refresh current tab AND its siblings (both ways acceptable).
2. Close a popup in onAfterWrite() to prevent loading the DataObject that doesn't exist.

Thx a lot for any hints.