HTML Web widget

The widget is used to load one web page thorough the URL. Users can set up services by configuring the attributes of the widget, which is the main objective of the predefined widget. The attributes, such as URL and height, of HTML Web Widget, can be set by the users.

Widget structure

This widget can be found in the BTTWeb2InternetBankWeb of BTT Web2.0 On-Demond Workplace sample, which consists of HTMLWgt.xml and HTMLWgt.js.

Widget Structure of HTML Web widget in the sample

The HTMLWgt.xml file defines the attributes of the widget, indicates the JavaScirpt file that contains the main class for the widget, and describes the content which is displayed on the web page.

HTMLWgt.xml

The HTMLWgt.js defined the JavaScriptâ„¢ class that implements some callback functions, invoked when some specific actions are triggered. These callback functions contains onLoad, onSave, onEdit, onMax, onRestore and onRefresh.

Widget usage

The HTML Web Widget allows the users to set the attributes, such as URL and height. To use it, users first need to register the widget in the widget catalog file. In the sample of BTT Web2.0 On-Demond Workplace, the catalog file is the WidgetCatalog.xml. So one item needs to be added in the file for this widget,
<entry id='simpleHTMLWgt' definition='../widget/basic/HTMLWgt.xml'></entry>
Through the above setting, the entry id simpleHTMLWgt is related to the HTML Web widget. Now some services can be published with the HTML Web widget. In the service definition file, In the sample of BTT Web2.0 On-Demond Workplace, the catalog file is the Service.xml, we add the service definition and set the attributes.
<Service id="0.1" name="html_service" desc="html_service" logo="theme/servicelogo/navlogo.gif">
  <Widget name="simpleHTMLWgt">
    <attribute name="url" value="http://www.ibm.com" />
  </Widget>
</Service>

Here we set the url attribute to http://www.ibm.com, and the height will use the default value defined in the HTMLWgt.xml file. So when the service is loaded, the web page of www.ibm.com is displayed in the frame of the service instance.

the page defined by the widget