BTT Web2.0 Widget provides a set of modes for the web developer, and the web developer can insert those modes in widget window, such as view, collapse, max, close, edit and refresh.
Parameter | Description |
---|---|
view | The widget window can be initiated and displayed. |
edit | The widget window will have an edit icon and its attributes can be edited. |
max | The widget window will have a maximization icon and can be maximized. |
collapse | The widget window will have a collapse icon and can be collapsed. |
refresh | The widget window will have a refresh icon and can be refreshed. |
close | The widget window will have a close icon and can be closed. |
For example, web developer can define mode in the widget definition file in this way:
<iw:iwidget name="simpleHTMLWgt" xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" iScope="simpleHTMLWgt" supportedModes="view collapse max close edit refresh" mode="view"> ... </iw:iwidget>
The corresponding widget window is as follows.
this.onSave = function(){ this.rootFrame.height = parseInt(this.iContext.getAttributeById("height")); }
this.onMax = function(){ this.rootFrame.height = "100%" ; }
this.onRestore = function(size){ this.rootFrame.height = parseInt(this.iContext.getAttributeById("height")) }