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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Force reload onAfterWrite


Reply


7 Posts   1606 Views

Avatar
k0m0r

Community Member, 39 Posts

7 October 2010 at 6:01pm

Edited: 07/10/2010 6:02pm

Hi.
Is there any way of forcing CMS page reload, after saving DataObject in a popup?
I've got a DataObject that creates another object onAfterWrite. So I open a popup, click on 'save', and a new object is supposed to be added into another DOM (separate tab). But it doesn't show up until page reload, which is obvious.
I would like to force entire page reload when my object is successfully saved in a popup.
How do I do this?
Thx a lot.

Avatar
Martijn

Community Member, 271 Posts

7 October 2010 at 10:26pm

You mean? :

LeftAndMain::ForceReload ();

Avatar
k0m0r

Community Member, 39 Posts

7 October 2010 at 11:25pm

Calling this inside a popup has no effect :(

Avatar
UncleCheese

Forum Moderator, 4094 Posts

8 October 2010 at 2:56am

Yeah, that won't work in a popup. I really can't think of any clean way to do this, to be honest. I'm sure with enough coding it's possible, but it would be pretty experimental.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
k0m0r

Community Member, 39 Posts

8 October 2010 at 11:33am

Edited: 08/10/2010 11:35am

Uncle Cheese, even most experimental really does work fine for me. I don't need it to be kosher, as the whole project is coded guerilla style. I just need to refresh the page no matter how, cause every other solution is worse than that.

Avatar
k0m0r

Community Member, 39 Posts

8 October 2010 at 10:33pm

Alright, I've been thinking about this - and what I exactly need to do, is to close the popup, reload tab being the parent, and all of its siblings.
For example, I have three tabs in Root.Content: tabA, tabB and tabC, each containing one DataObjectManager.
I open a popup in one of them, save an object, and inside its onAfterWrite I need to close the popup and reload tabs A,B,C.

Avatar
Futureweb

Community Member, 233 Posts

5 October 2011 at 10:43am

just a following up on this? did anyone get this working?

i have a shopping system - if someone adds a an extra item to the orders list (using dataobjectmanager) i need to refresh the other tabs which have a summary of the total order amounts...

Cheers