Trigger refresh of UI

Mari Jørgensen
Member since: 2003
 

I have a dojo custom property where the content of another property on the page is edited through a web api call. The web api controller saves a new version of the page.

How can I tell epi to refresh the page?  Much like autosave is triggered when changing a property on the page through the input controls.

#188715 Mar 01, 2018 14:20
  • David Knipe
    Member since: 2008
     

    Hi Mari

    I'd say you need to publish a Dojo topic to inform the UI to refresh, I'd guess at /epi/cms/contentdata/updated. More info on the topic system in Dojo from the awesome Greg Wiecheć herehttps://gregwiechec.com/2015/08/using-dojo-topic-publish-and-topic-subscribe/

    David

    #188732 Mar 01, 2018 20:32
  • Mari Jørgensen
    Member since: 2003
     

    Yes, David, you are right! The following did the trick:

    topic.publish("/epi/shell/context/request", {
                           uri: "epi.cms.contentdata:///" + newContentLink
                       }, {
                               sender: this,
                               viewName: this.view,
                               forceContextChange: true,
                               forceReload: true
                           });
    #188758 Mar 02, 2018 10:01
  • David Knipe
    Member since: 2008
     

    Hey Mari, glad my suggestion helped and thanks for sharing your solution! 

    #188772 Mar 02, 2018 14:22