Try our conversational search powered by Generative AI!

Refresh editor properties when changes has been made in back-end.


I am performing some property changes via api calls to backend and i need to tell the editor to refresh its state. Right now, the "Publish" button does not get lit since the editor doesn't detect the backend changes - how can i tell the editor properties has changed and that it should refresh its state?

Obviously i am not using custom Dojo widgets and i would like to avoid it if i can. I use window.epi.subscribe() to detect changes performed by epi but i cannot find a similar notification i can use with window.epi.publish() to tell epi the same thing. 

What am i missing? Surely i can't be the only person in the world with this issue.

Feb 24, 2021 13:58

have not come across this scenario before but if your editors are changing properties in the OnPage edit view, have you tried

@Html.FullRefreshPropertiesMetaData(new[] { "your-content-area" })
Feb 24, 2021 21:23

No that won't help. It simply provides a "map" structure when the page is loaded so that properties within the page can tell wether it should update or not if another property is change. But the change must originate client side - it doesn't provide a channel from serverside.

Let me tear down the problem to a simple one;

On the edit page, i want a button: "Populate".

When pressed, i want to change the content of the page (multiple properties) server-side.

Once pressed, i want epi to understand the content have changed, and the editor should act accordinly and refresh (lighting up the "publish" button, for instance).

The server-side part is no problem. I have my api endpoint on which i send a POST request once the button is pressed. What i lack is the ability to tell epi the content have changed. How can i perform this?

Mar 12, 2021 10:22

 I believe you need to create a context-sensitive component. Once properties changed from the backend you need to notify context and push a message for content editors. 

the following documentation will be useful 

Mar 14, 2021 16:05

As mentioned, the only way to update the Epi interface after you have made an update through the backend is to have a Dojo component that updates the front-end. When changes occur in the editor interface, the Dojo components actually call back to the back-end to save the changes, and the updates you then see in the editor are made by Dojo as well. Changes to the editor are not actually based on what happens in the back-end. The only way to see a back-end change without a Dojo component performing an update or save event is to refresh the entire interface.

Edited, Mar 31, 2021 20:55

This should help you

Look for ReloadOnChange attribute. This attribute allows to force-refresh the current content context on the server and force rerender all other properties.

More info:

Oct 14, 2021 7:24
huseyinerdinc - Dec 17, 2021 13:28
Is ReloadOnChange only available on version 12? How can we achieve this on v11, without touching Dojo?
Bartosz Sekula - Dec 17, 2021 14:33
Please read the linked blog post
huseyinerdinc - Dec 17, 2021 14:36
I missed that tiny little detail. :) Thanks.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.