BTT Web 2.0 Widget provides a set of modes for the web developer, and you can add those modes for widget instance window, such as view, collapse, max, close, edit and refresh.
Parameter | Description |
---|---|
view | The widget instance window is initiated and displayed. |
edit | The widget instance window will have an edit icon and its attributes can be edited. |
max | The widget instance window will have a maximization icon and can be maximized. |
collapse | The widget instance window will have a collapse icon and can be collapsed. |
refresh | The widget instance window will have a refresh icon and can be refreshed. |
close | The widget instance window will have a close icon and can be closed. |
For example, you can add modes 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 instance 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")) }