Saturday 17 September 2011

Component of Widget


The iContext is the view of the iWidget instance context supplied at runtime.

At runtime, the iContext supplied to the iScope by the runtime environment provides the means for the iWidget instance to interact with its
surroundings such as
a localised getElementById() method for accessing UI elements.
accessors for attributes defined for the specific iWidget instance.


In model-view-controller terms you can think of the iScope JavaScript class as the controller for the iWidget.

The iScope orchestrates how the iWidget responds to events, retrieves its data and manipulates the UI.

 
IContext Methods:

Method Name
Description
getiWidgetAttributes()
returns ManagedItemSet to provide access to the widget’s customization attributes.
getItemSet(itemSetName)
returns an ItemSet corresponding to the requested name or creates a new one. Lotus Mashups forces the policy that all the ItemSet values are private ItemSet.
iScope();
returns the instance object that encapsulates all the widget script variables
getElementById();
returns a dom element of the widget.
getRootElement();
returns the root element of the widget.
getElementsByClass();
returns an array of elements in the widget markup that have the supplied value as one of those specified by the element's class attribute
processMarkup();
processes the markup so that it can be inserted into the widget’s markup.
processiWidgets()
requests that the iContext object process the subtree under the supplied node in order to resolve and instantiate any referenced widgets.
getUserProfile();
returns ManagedItemSet to provides access to the user's profile data.
getiDescriptor();
returns ManagedItemSet to provide access to attributes that both the iContext object and the widget require.
getWidgetId()
This method returns the unique identifier for this instance of the iWidget in the current evironment
(usually a web page).
requires()
This method provides the means for an iWidget to dynamically declare a dependency on a resource,
including optional iContext functionality, such as: Io,xml

No comments:

Post a Comment