|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public WidgetModel
WidgetModel interface defines functions that expose information of a widget model.
Global model available to all the page components.
var widgetModel = com.ibm.mashups.iwidget.model.Factory.getGlobalWidgetModel();
Method Summary | |
---|---|
IWidgetWrapper |
find(String id)
Returns an iWidgetWrapper object which represents a runtime instance of an iWidget object. |
Boolean |
hasChildren(com.ibm.mashups.iwidget.iWidgetWrapper iWidgetWrapper)
Returns whether or not the given node has children. |
IWidgetWrapper[] |
getChildren(IWidgetWrapper iWidgetWrapper,
Boolean isNested)
Returns an array of iWidgetWrapper object. |
IWidgetWrapper |
getParent(IWidgetWrapper iWidgetWrapper)
Returns the parent object of the specified iWidgetWrapper object . |
com.ibm.mashups.enabler.Deferred |
getWidgetDefinitionByUrl(String url)
Deprecated. Use getWidgetDefinitionByURL instead. |
com.ibm.mashups.enabler.Deferred |
getWidgetDefinitionByURL(String url)
Returns the deferred object used to start this operation and an IWidgetDefinition object is returned when deferred object is executed. |
DeferredOperation |
commit()
Commits the modifications applied to this model and all dependent models. |
IWidgetDefinition |
createIWidgetDefinition(Object json)
Returns iWidgetDefinition object for the specified JSON object. |
IWidgetWrapper |
createWidget(Object span)
Creates a widget and associates it with a span element on the page |
Method Detail |
---|
IWidgetWrapper find(String id)
<span class="iw-iWidget" id="{id}">
id
-
unique id of an iWidget wrapper. Must not be NULL.
Boolean hasChildren(com.ibm.mashups.iwidget.iWidgetWrapper iWidgetWrapper)
iWidgetWrapper
-
parent iWidgetWrapper object. Must not be NULL.
IWidgetWrapper[] getChildren(IWidgetWrapper iWidgetWrapper, Boolean isNested)
iWidgetWrapper
-
parent object .Must not be NULL.isNested
-
optional. the default value is TRUE. It returns all the nested iWidgets if it's true. It returns only direct children if it's false.
IWidgetWrapper getParent(IWidgetWrapper iWidgetWrapper)
iWidgetWrapper
-
iWidgetWrapper object. Must not be NULL.
com.ibm.mashups.enabler.Deferred getWidgetDefinitionByUrl(String url)
var deferred = widgetModel.getWidgetDefinitionByUrl(url)
deferred.setFinishedCallback(callback,parameters);
deferred.start(false);
resource
- IWidgetDefinition object statuscode
- the HTTP status,code of the action .params
- optional. may use this to pass additional parameters into the callback .function callback(resource, statuscode, params)
{
if (statuscode == 200)
{
var defObj = resource;
... }
}
url
-
url to load widget definition. Must not be NULL.
IWidgetDefinition
com.ibm.mashups.enabler.Deferred getWidgetDefinitionByURL(String url)
var deferred = widgetModel.getWidgetDefinitionByUrl(url)
deferred.setFinishedCallback(callback,parameters);
deferred.start(false);
resource
- IWidgetDefinition object statuscode
- the HTTP status,code of the action .params
- optional. may use this to pass additional parameters into the callback .function callback(resource, statuscode, params)
{
if (statuscode == 200)
{
var defObj = resource;
... }
}
url
-
url to load widget definition. Must not be NULL.
IWidgetDefinition
DeferredOperation commit()
null
IWidgetDefinition createIWidgetDefinition(Object json)
json
-
JSON object. Must not be NULL.
IWidgetDefinition
IWidgetWrapper createWidget(Object span)
span
-
DOMElement to associate the widget with. Must not be NULL.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |