Extending : Widget extension : Widget extension samples : Compound widget to bind kColl data : Extending in Runtime
  
Extending in Runtime
Prerequisite
Create a UNICOM® Digital Transformation Toolkit (UDTT™) Project for runtime code implementation. Please download the sample code from:
Widget_runtime.zip
Procedure
1 Create a widget layout template "CurrencyWidget".html in “\WebContent\js\com\ibm\btt\dijit\templates”.
2 Create javascript file “CurrencyWidget.js” in runtime project directory “\WebContent\js\com\ibm\btt\dijit\”, which includes single widget loading, display, data layout and submit logic.
3 Create javascript file “CurrencyColumnWidget.js” in runtime project directory “\WebContent\js\com\ibm\btt\dijit\”, which includes the widget loading, layout and sorting logic in table column.
4 Create java file “src\com\ibm\btt\dojo\alphatest\tag\DojoCurrencyWidgetTag.java”, which will handle the data submit logic in channel level.
5 Create java file “src\com\ibm\btt\dojo\alphatest\tag\DojoCurrencyWidgetTableTag.java”, which will handle the CurrencyWidget logic in table column.
6 Update bttdojo.tld.
Add new tag “currencywidget” below:
This graphic is described in the surrounding text.
Update column tag class as below:
This graphic is described in the surrounding text.
7 Update template, add two new javascript files:
This graphic is described in the surrounding text.
8 Prepare the list file for widget as the selected data source, for example: currency.js
This graphic is described in the surrounding text.
9 Prepare keyedcollection data which will binding to CurrencyWidget, it should have two simple data element named “currency” and “amount”.
This graphic is described in the surrounding text.
See also
Compound widget to bind kColl data