Custom Widget Saving

Posted by Community Admin on 04-Aug-2018 17:07

Custom Widget Saving

All Replies

Posted by Community Admin on 10-Feb-2012 00:00

I have a widget (a "game player") that has instances which determine what game is played. I want to be able to modify and add instances in the widget designer, so it comes down to I want my widget designer to be able to do three different things.

Those three things are:
1. Select an already existing instance.
2. Change parameters of an already existing instance.
3. Add a brand new instance.

Each of those three things have their own panel, and I use buttons to switch between the three. Here's the thing: when I click Save in the designer, I only want to actually save based on which of the panels is visible. It seems like I should be overriding a function, but I'm not sure which one.

Any help is greatly appreciated.

Thanks,
Chris

Posted by Community Admin on 15-Feb-2012 00:00

Hi Chris,

The request is a hardly achievable with the current implementation of the control designers. However what I can suggest you is to work with the applyChanges method, which actually saves the changes to the control. In it you can try to implement some logic, which should be picking the current view of the designer and saving whatever changes were made. Please note that making the control selectively to save the changes that are made might not be easy. You can also have a look at the following article from our documentation, which has more information about the methods, that might be useful to you:

www.sitefinity.com/.../creating-a-view

Kind regards,
Victor Velev
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 15-Feb-2012 00:00

Victor,

I found a way to do this... as it turns out if you use 3 different panels and change the visibility the controls on the hidden panels have null values, so I can check for the non-null values and do different things based on those.

Now to figure out how to get JavaScript and c# to talk to each other, and I'm good.

Thanks,
Chris

Posted by Community Admin on 16-Feb-2012 00:00

Hi Chris,

The following articles may be useful to you:

http://social.msdn.microsoft.com/Forums/en/netfxjscript/thread/3efc7bf9-730f-47d0-bc9c-7a3550cf1282

http://forums.asp.net/t/1117189.aspx/1

www.daniweb.com/.../31065

Kind regards,
Victor Velev
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