HTML Web widget

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

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, and indicates the JavaScript file that contains the main class for the widget, and also describes the content which is displayed on the web page.

HTMLWgt.xml

The HTMLWgt.js defines the JavaScript class that implements some callback functions that are invoked when some specific actions are triggered. These callback functions include onLoad, onSave, onEdit, onMax, onRestore and onRefresh.

Widget usage

The HTML Web Widget allows you to set the attributes, such as URL and height. To use it, you must register the widget in the widget catalog file. In the sample of BTT Web 2.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 sample of BTT Web2.0 On-Demond Workplace, the service definition file is the Service.xml. Add the service definition and set the attributes as follows:
<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>

The url attribute is set to http://www.ibm.com, and the height attribute uses 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 wideget instance.

the page defined by the widget