More in this section

Forums / Developing with Sitefinity / Complex Widget Property

Complex Widget Property

2 posts, 0 answered
  1. Neil
    Neil avatar
    30 posts
    Registered:
    20 Jan 2009
    08 Oct 2011
    Link to this post
    Hi folks, I'm still in the process of migrating my 3.7 controls to the new 4.2 architecture. I have a control with a complex property, basically a list of objects with a few properties each. In the 3.7 world I used server side processing to update the results of editing in the designer.

    In the new architecture, how would I go about saving these changes? My template has a populated listbox, and a few text boxes to display and edit the selected item. I need to figure out the appropriate way to expose these items, and to save them back to the control. 

    Any thoughts/guidance on the right approach here would be much appreciated. At this point I've got client side events firing for the listbox item being selected, and now  I need to display then save the edited values.

    Thanks in advance
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    12 Oct 2011
    Link to this post
    Hello Neil,

    You have two options for persisting the values. The first one is to persist all changes when the save button is clicked. This will call the applyChanges() method of the clients side component of your designer. In this method you get the control data as shown in this article and save the selected values of the list. I think that this is the best place to save changes, because if cancel is clicked nothing will be persisted. Refer to: http://www.sitefinity.com/40/help/developers-guide/how-to-how-to-create-a-date-picker-control-creating-the-control-designer-implementing-the-features-of-the-designer-view.html#implementingcontentviewdesignerview.

    The second approach is to save changes in your client side events. Again you have to get the control data object and amend its properties. However if cancel is clicked you have to roll back changes to original ones, which is not as convenient.



    All the best,
    Radoslav Georgiev
    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
2 posts, 0 answered