com.ibm.mashups.iwidget.widget
Interface IWidgetWrapper

All Superinterfaces:
EventProvider, WireProvider

public IWidgetWrapper
extends WireProvider, EventProvider

IWidgetWrapper interface represents a runtime instance of an iWidget on the page. Information provided by the IWidgetWrapper is an aggregation of definition level data and instance level data. To get desriptive data that's specific to instance level and definition level. It should use Provider api that's implemented by IWidgetDefinition or IWidgetIstance.


Method Summary
 com.ibm.mashups.enabler.Deferred getIWidgetDefinition()
           This method returns iWidgetDefinition of this runtime instance.
 void setIWidgetDefinition(IWidgetDefinition widgetDefinition)
           Sets the iWidgetDefinition for this runtime instance
 IWidgetInstance getIWidgetInstance()
           This method returns iWidgetInstance which contains all the descriptive data for this iWidget instance
 com.ibm.mashups.enabler.Deferred getMarkup()
           This method returns the a clone of the content of the widget as it is inside of the DOM.
 Boolean isLoaded()
           This method returns true if an iwidget instance is already loaded on the page dom.
 Boolean isStandalone()
           This method returns true if an iwidget instance is standalone on the page.
 void doRender()
           This method displays the widgets on the page if widget has not been displayed yet.
 
Methods inherited from interface com.ibm.mashups.iwidget.widget.WireProvider
getWires
 
Methods inherited from interface com.ibm.mashups.iwidget.widget.EventProvider
getWidgetPublishedEvents, getWidgetHandledEvents, getPublicEvent
 

Method Detail

getIWidgetDefinition

com.ibm.mashups.enabler.Deferred getIWidgetDefinition()
This method returns iWidgetDefinition of this runtime instance.
var deferred = widgetWrapper.getIWidgetDefinition();
deferred.setFinishedCallback(callback,parameters);
deferred.start(true);
here are the callback parameters that will be passed into callback function:
    resource - IWidgetDefinition object
    statusCode - the overall HTTP status,code of the action (the highest status code of the involved operations).
    params - the parameters passed into the callback

Returns:
a deferred object used to start this operation.
See Also:
IWidgetDefinition

setIWidgetDefinition

void setIWidgetDefinition(IWidgetDefinition widgetDefinition)
Sets the iWidgetDefinition for this runtime instance

Parameters:
widgetDefinition - IWidgetDefinition to use for this runtime instance. Must not be null.

getIWidgetInstance

IWidgetInstance getIWidgetInstance()
This method returns iWidgetInstance which contains all the descriptive data for this iWidget instance

Returns:
iWidgetInstance object

getMarkup

com.ibm.mashups.enabler.Deferred getMarkup()
This method returns the a clone of the content of the widget as it is inside of the DOM.
It removes automatically any markup that was added to the DOM using microformats (given that the microformat implements the unProcess handler).
This method does not remove any additional DOM changes that where done by the widget itself and applies the unProcess only
to the subnodes of the actual widget node.

If your widget needs to take special action to it's DOM nodes before the getMarkup is processing it, you can define the method
_onGetMarkup in your widgets JavaScript file. This method, as part of the iScope, will always be called before the actual
markup is processed.

The synchrounus mode of returned Deferred is not supported.

Returns:
a deferred object used to fetch the actual markup.

isLoaded

Boolean isLoaded()
This method returns true if an iwidget instance is already loaded on the page dom.

Returns:
true if widget is already completely rendered on the page.

isStandalone

Boolean isStandalone()
This method returns true if an iwidget instance is standalone on the page.

Returns:
true if widget is standalone on the page.

doRender

void doRender()
This method displays the widgets on the page if widget has not been displayed yet.



Copyright IBM Corp. 2010 All Rights Reserved.