The ToggleButton widget is a very simple widget. onText is displayed on the button by default. When it is clicked, offText is displayed on the button. Meanwhile, the onClick event is added to the widget so that when the button is clicked, the onClick event is triggered.
Although the ToggleButton widget it is a simple example, more complex widget extension tasks are also covered in the example to enable technical developers who have an overall understanding of UDTT extend widgets quickly. Listed below are tasks that are covered in this sample:
▪ Creating a new widget definition .xml file for the widget.
▪ Registering a widget extension point in the plugin.xml file.
▪ Creating widget mapping file.
▪ Adding widget mapping extension point in the plugin.xml file.
▪ Implement jsp handler class for the widget.
▪ Implement JavaScript code for the widget.
▪ Modify template.jsp to add required js implementation for the widget.
▪ Create alphadojo.tld to add extended jsp tags for the widget.
The implementation items of this sample are in two projects: