com.ibm.mashups.iwidget
Interface Constants


public Constants

com.ibm.mashups.iwidget.Constants defines all the public iwidget framework constants.
Each constants should be referred to as : com.ibm.mashups.iwidget.Constants.WIDGET_LOADED...


Field Summary
 String WIDGET_LOADED
           Enabler would publish WIDGET_LOADED event when an iwidget is loaded.
 String RESIZE_WIDGET
           Enabler would subscribe this event and page components could publish RESIZE_WIDGET event to indicate an iwidget need to be resized.
 String UNLOAD_WIDGETS
           Enabler would subscribe this event and page components could publish UNLOAD_WIDGETS event to unload certain widgets.
 String WIDGETS_UNLOADED
           Enabler would publish WIDGETS_UNLOADED event when requested iwidgets are unloaded.
 

Field Detail

WIDGET_LOADED

String WIDGET_LOADED
Enabler would publish WIDGET_LOADED event when an iwidget is loaded.
Event: com.ibm.mashups.iwidget.Constants.WIDGET_LOADED
Value:"com.ibm.mashups.iwidget.widgetloaded"
Payload: String -- widgetid
For example: When event is published, a name convention is use: com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+widgetId An widget could subscribe to this event by using following SPI: var eventService = com.ibm.mashups.services.ServiceManager.getService("eventService"); eventService.subscribeEvent(com.ibm.mashups.iwidget.Constants.WIDGET_LOADED+"."+widgetId,scopeobject,"mycallbackfn");


RESIZE_WIDGET

String RESIZE_WIDGET
Enabler would subscribe this event and page components could publish RESIZE_WIDGET event to indicate an iwidget need to be resized.
When event is published, a name convention is used: com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET+"."+widgetId Page component should publish event by using following SPI: var eventService = com.ibm.mashups.services.ServiceManager.getService("eventService"); eventService.publishEvent(com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET+"."+widgetId,payload); Event: com.ibm.mashups.iwidget.Constants.RESIZE_WIDGET
Value:"com.ibm.mashups.iwidget.resizewidget"
Payload: JSON object: { "newWidth": "","newHeight": ""}


UNLOAD_WIDGETS

String UNLOAD_WIDGETS
Enabler would subscribe this event and page components could publish UNLOAD_WIDGETS event to unload certain widgets.
For example: layout widget could publish this event to unload all the widgets on the page upon page switch
When all the requested iwidgets are unloaded, enabler would publish event --com.ibm.mashups.iwidget.Constants.WIDGETS_UNLOADED
Event: com.ibm.mashups.iwidget.Constants.UNLOAD_WIDGETS
Value:"com.ibm.mashups.iwidget.unloadwidgets"
Payload: an array of widget id that need to be unloaded


WIDGETS_UNLOADED

String WIDGETS_UNLOADED
Enabler would publish WIDGETS_UNLOADED event when requested iwidgets are unloaded. This event is used together with com.ibm.mashups.iwidget.Constants.UNLOAD_WIDGETS.
Event: com.ibm.mashups.iwidget.Constants.WIDGETS_UNLOADED
Value:"com.ibm.mashups.iwidget.widgetsunloaded"
Payload: an array of widget id that are unloaded



Copyright IBM Corp. 2010 All Rights Reserved.