Complex Widget Property
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
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