Refresh Widget UI in Page Editor

Posted by Community Admin on 04-Aug-2018 15:44

Refresh Widget UI in Page Editor

All Replies

Posted by Community Admin on 01-Jul-2011 00:00

How can I make my widget display user changes from custom control designer...

like the out-of-the-box Content Block where after hitting "Save", will render the content in the Page Editor, I guess it is leveraging

- Services/Pages/ControlPropertyService.svc
- Services/Pages/ZoneEditorService.svc

how can I expose the properties to these methods or have the properties accesible to re-render them on the Page Editor, or populate the Html property of the JSON object, as I saw the Content Block use this value to render... or hook on some javascript event to re-render the widget UI...

hope I explained my need somewhat concisely...

Posted by Community Admin on 01-Jul-2011 00:00

Hello Readonlychild,

When you edit a widget and change it we do not refresh the entire page - it does not go to its entire lifecycle. In your custom control designer you can place the following code in the _saveChangesSuccess handler:

window.top.zoneEditorShared.set_isPageRefreshControlled(true);

before the line for window refresh:

window.parent.location.href = window.parent.location.href;

so when you click "Save" this should show your changes. We use the same approach when you change the template and force the page to go to its lifecycle, so you will see the changes.

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 01-Jul-2011 00:00

Thanks Ivan,

could you give me a little more reference, on how to implement the _saveChangesSuccess handler,

I've yet only used refreshUI and applyChanges on my custom controls.

Posted by Community Admin on 01-Jul-2011 00:00

Hello Readonlychild,

You need to use a delegate inside the client component

this._saveChangesSuccessDelegate = null;

this._saveChangesSuccessDelegate = Function.createDelegate(this, this._saveChangesSuccess);

 _saveChangesSuccess: function (caller, sender, args)
     
    ,

Take a look at this post  - forums.asp.net/.../3068730.aspx

All the best,
Ivan Dimitrov
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed