Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Force reload onAfterWrite

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1563 Views
  • k0m0r
    Avatar
    Community Member
    39 Posts

    Force reload onAfterWrite Link to this post

    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.

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Force reload onAfterWrite Link to this post

    You mean? :

    LeftAndMain::ForceReload ();

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: Force reload onAfterWrite Link to this post

    Calling this inside a popup has no effect

  • UncleCheese
    Avatar
    4085 Posts

    Re: Force reload onAfterWrite Link to this post

    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

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: Force reload onAfterWrite Link to this post

    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.

  • k0m0r
    Avatar
    Community Member
    39 Posts

    Re: Force reload onAfterWrite Link to this post

    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.

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: Force reload onAfterWrite Link to this post

    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

    1563 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.