The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
When implementing a widget, generally only one class is enough – the control that represents the widget. In Sitefinity, it is a very good idea to inherit from a base class called SimpleView, when implementing widgets.
If the widget is to be configured by the users, we may also decide to implement a widget designer, in order to provide a user friendly way of configuring the widget. Note that even if you don’t implement the widget designer, users will still be able to configure the widget through the automatically generated property grid. Now, take a look at the following screenshots to get a better feeling of the terminology.
Figure 2: Widget designer – this is the user friendly way to configure your widget. Note that widget designers need to be implemented; they are not automatically generated. You have absolute freedom in designing the user interface of a widget designer.
So, now that we are clear on the terminology, let’s start explaining the files included in the project and their purpose.
First, let me explain why is it necessary that the designers are implemented on the client side. Namely, Sitefinity 4.0 is not using postbacks at all – and this would introduce quite an inconsistency if we’d use postbacks here. In order to make both, designers and property grid, be synchronized and be so without the postbacks we have decided to go this way. There is no doubt that your users like this approach better.
Now, editing the server side controls through a client side code is not exactly trivial matter. However, by providing a framework that takes care of persistence of properties, proper event calling, serialization and deserialization of the controls, we have simplified this to a trivial task. If you think about it, all that you are required to do is to modify a javascript object that looks exactly the same as your server side control – Sitefinity takes care of everything else.
The sample provided in this blog post can be used as a starting point for any widget / designer implementation and by minimally changing it (only the things that are really different) you can have your designers up and running in no time. For example, it took me less than 2 hours to write this sample.
I hope this clarifies some of the misunderstandings with the new approach to widgets and designers.View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.