Implementing a widget to display a type

A simple data type can be integrated with the IBM® WebSphere® Multichannel Bank Transformation Toolkit XUI editor. This means that when a field of a specific type is selected, such as the dataName field of the TextBox widget, the XUI editor automatically generates a widget for this type. For example, if the Date type field is chosen, a DateTextBox widget is automatically generated as the presentation widget. A technical developer must implement a presentation widget for the simple type that has been defined.

A technical developer must do the following three steps to register and implement a presentation widget for a new simple data type:

Extend the WebSphere Multichannel Bank Transformation Toolkit JSP tag handler for the TextBox widget

To extend the WebSphere Multichannel Bank Transformation Toolkit JSP tag handler for the TextBox widget, a technical developer must extend the com.ibm.btt.dojo.tag.DojoTextBoxTag class and override the getWidgetType method. So DOJO widget class for the new type can be returned if the dataName of the TextBox widget is in this type.

Shown below is a simple code of implementation:
protected String getWidgetType(String type) {
		if ("TimeZone".equalsIgnoreCase(type)) {
			return "com.ibm.btt.dijit.TimeZoneTextBox";
		}
		else{
			return super.getWidgetType(type);
		}
	}

Modify bttdojo.tld

After extending the JSP tag handler for the TextBox widget, a technical developer must modify the bttdojo.tld file to use the new tag handler for the TextBox widget. A technical developer can search for the tag with the name of textbox, and then change the ‘tag-class' to be the class implemented previously

JavaScript implementation

To implement JavaScript for the new data type as presentation widget, a technical developer must extend the WebSphere Multichannel Bank Transformation Toolkit com.ibm.btt.dijit.ValidationTextBox base class and override the validator method.