More in this section

Forums / Developing with Sitefinity / Custom Widget Saving

Custom Widget Saving

4 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    10 Feb 2012
    Link to this post
    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
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    15 Feb 2012
    Link to this post
    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:

    http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/controls/working-with-control-designers/multi-view-control-designers/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
  3. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    15 Feb 2012
    Link to this post
    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
  4. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    16 Feb 2012
    Link to this post
    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

    http://www.daniweb.com/web-development/aspnet/threads/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
4 posts, 0 answered