1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Refresh Widget UI in Page Editor

Refresh Widget UI in Page Editor

4 posts, 0 answered
  1. readonlychild
    readonlychild avatar
    67 posts
    Registered:
    26 May 2011
    01 Jul 2011
    Link to this post
    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...
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Jul 2011
    Link to this post
    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
  3. readonlychild
    readonlychild avatar
    67 posts
    Registered:
    26 May 2011
    01 Jul 2011
    Link to this post
    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.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Jul 2011
    Link to this post
    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  - http://forums.asp.net/p/1407025/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
4 posts, 0 answered