Class DataWidget
This is the basic class that represents a DataWidget.
This class exposes main functions to manipulate a DataWidget from a custom DataWidget renderer
or any API function called by the DreamFace Engine when a DataWidget needs to be displayed or
personalized.
Defined in: dfDataWidget.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Construct a new DataWidget object.
|
| Method Attributes | Method Name and Description |
|---|---|
|
Add an xHTML fragment (DIV, IFRAME, TABLE, .
|
|
|
Add an edit HTML field in the edit form.
|
|
|
Add an edit input field in the edit form.
|
|
|
Add a root field in the edit form.
|
|
|
bindEvent(String, callback)
Bind a DataWidget Event to a Function
|
|
|
Clear the DataWidget's content.
|
|
|
Internal Function.
|
|
|
Display the DataWidget color associated to the DataWidget instance.
|
|
|
Execute the DataSource associated with the DataWidget.
|
|
|
Return an array of actions used by interactions
|
|
|
Return a String representing the document of actions used by interactions
|
|
|
Return a String value that defines the DataWidget's background color.
|
|
|
Return a String value that defines the DataWidget's border color.
|
|
|
Return a String value that defines the DataWidget's border title style.
|
|
|
Return a String value ("true" or "false") that defines if the DataWidget's border is visible.
|
|
|
getData()
Return the Data resulting from the DataSource execution.
|
|
|
Return the Data resulting from the DataSource execution as Text.
|
|
|
Return the DataSource name associated to the DataWidget instance.
|
|
|
Return the DataSource parameters used by the DataWidget when executing the DataSource.
|
|
|
Return the DataSource Request.
|
|
|
Return the directory attached to the DataWidget
|
|
|
Return the directory component (Flex or XForms) attached to the DataWidget
|
|
|
Return the directory component (Flex or XForms) binding source
|
|
|
Return an array of events used by interactions
|
|
|
Return a String representing the document of events used by interactions
|
|
|
Return the DataWidget height
|
|
|
getIcon()
Return the icon image of the DataWidget instance.
|
|
|
Return the instance number of the DataWidget.
|
|
|
getName()
Return the name (i.e the identifier) of the DataWidget instance.
|
|
|
Return the parameter value of the DataWidget instance.
|
|
|
Return the parameters of the DataWidget instance.
|
|
|
Return the parameters of the DataWidget instance as Text.
|
|
|
Return a preference value of the DataWidget instance.
|
|
|
Return the preferences of the DataWidget instance.
|
|
|
Return the preferences of the DataWidget instance as Text.
|
|
|
Retrieve the DataWidget JavaScript renderer associated to the template.
|
|
|
Return the DataWidget template used to create the DataWidget instance.
|
|
|
Return the name of the DataWidget template used to create the DataWidget instance.
|
|
|
getTitle()
Return the title of the DataWidget instance.
|
|
|
Return a String value ("true" or "false") that defines if the DataWidget's title bar is visible.
|
|
|
Return the DataWidget class associated to the DataWidget instance.
|
|
|
Return the name of the DataWidget class associated to the DataWidget instance.
|
|
|
getWidth()
Return the DataWidget width
|
|
|
loadData()
Retrieve Data according to a DataSource definition.
|
|
|
Load the DataWidget template.
|
|
|
redraw()
Clear the DataWidget and recall the renderer.
|
|
|
Retrieve Data according to a DataSource definition.
|
|
|
reload()
Clear the DataWidget preferences and reload the DataWidget content (implies a reload of preferences).
|
|
|
Save preferences of the DataWidget.
|
|
|
Define the DataWidget background color.
|
|
|
Define the DataWidget border color.
|
|
|
Define if the DataWidget border is visible.
|
|
|
setData()
Set the Data to be displayed by the DataWidget.
|
|
|
Set the Data as Text to be displayed by the DataWidget.
|
|
|
Set the DataSource name.
|
|
|
Set the value of one of the DataSource parameters used by the DataWidget when executing the DataSource.
|
|
|
Set the DataSource parameters used by the DataWidget when executing the DataSource.
|
|
|
Set the DataSource Request.
|
|
|
Attach a directory to the DataWidget
|
|
|
Attach a directory component (Flex or XForms) to the DataWidget
|
|
|
Set an edit field value.
|
|
|
setHeight(int)
Set the DataWidget height
|
|
|
setIcon()
Set the DataWidget icon image.
|
|
|
Set the DataWidget instance.
|
|
|
setName()
Set the DataWidget name.
|
|
|
Set a DataWidget preference.
|
|
|
Set the DataWidget template.
|
|
|
setTitle()
Set the DataWidget title.
|
|
|
Define if the DataWidget title bar is visible.
|
|
|
Set the DataWidget class name associated to the DataWidget instance.
|
|
|
triggerEvent(String)
Trigger an Event on the DataWidget
|
Class Detail
DataWidget()
Construct a new DataWidget object.
- Parameters:
- {Document} dataWidgetDefinition.
- The DataWidget Definition.
- Returns:
- A new DataWidget instance
Method Detail
addContent()
Add an xHTML fragment (DIV, IFRAME, TABLE, ...) to the DataWidget's content.
- Parameters:
- {String} fragment.
- The XHTML fragment to be added.
addEditHTMLField()
Add an edit HTML field in the edit form.
- Parameters:
- {String} label.
- The root field displayed label.
- {String} html.
- The html content to display the field.
addEditImputField()
Add an edit input field in the edit form.
- Parameters:
- {String} label.
- The input field displayed label.
- {String} id.
- The input field id.
addEditRootField()
Add a root field in the edit form. The root field value will be used to generate the root
tag of the widget's preferences XML fragment
- Parameters:
- {String} value.
- The root field value.
bindEvent(String, callback)
Bind a DataWidget Event to a Function
- Parameters:
- String
- event. The event name.
- callback
clearContent()
Clear the DataWidget's content.
construct()
Internal Function. Initialize the DataWidget instance from the Document that represents the DataWidget.
- Parameters:
- {Document} dataWidgetDefinition.
- The DataWidget Definition.
displayColor()
Display the DataWidget color associated to the DataWidget instance.
executeDataSource()
Execute the DataSource associated with the DataWidget.
- Parameters:
- {String} callback.
- The callback function to call.
{Array}
getActions()
Return an array of actions used by interactions
{String}
getActionsAsXMLString()
Return a String representing the document of actions used by interactions
{String}
getBackgroundColor()
Return a String value that defines the DataWidget's background color.
{String}
getBorderColor()
Return a String value that defines the DataWidget's border color.
{String}
getBorderTitleStyle()
Return a String value that defines the DataWidget's border title style.
{String}
getBorderVisibility()
Return a String value ("true" or "false") that defines if the DataWidget's border is visible.
{Document}
getData()
Return the Data resulting from the DataSource execution.
{String}
getDataAsText()
Return the Data resulting from the DataSource execution as Text.
{String}
getDataSourceName()
Return the DataSource name associated to the DataWidget instance.
{Document}
getDataSourceParameters()
Return the DataSource parameters used by the DataWidget when executing the DataSource.
{String}
getDataSourceRequest()
Return the DataSource Request.
{String}
getDirectory()
Return the directory attached to the DataWidget
{String}
getDirectoryComponent()
Return the directory component (Flex or XForms) attached to the DataWidget
{String}
getDirectoryComponentBinding()
Return the directory component (Flex or XForms) binding source
{Array}
getEvents()
Return an array of events used by interactions
{String}
getEventsAsXMLString()
Return a String representing the document of events used by interactions
{int}
getHeight()
Return the DataWidget height
{String}
getIcon()
Return the icon image of the DataWidget instance.
{int}
getInstance()
Return the instance number of the DataWidget. The instance number is unique on each screen, starting at 0.
{String}
getName()
Return the name (i.e the identifier) of the DataWidget instance. The name is unique on each screen.
{String}
getParameter()
Return the parameter value of the DataWidget instance.
- Parameters:
- {String} paramName.
- The parameter name.
{Document}
getParameters()
Return the parameters of the DataWidget instance.
{String}
getParametersAsText()
Return the parameters of the DataWidget instance as Text.
{String}
getPreference()
Return a preference value of the DataWidget instance.
- Parameters:
- {String} preferenceName.
- The preference name.
{Document}
getPreferences()
Return the preferences of the DataWidget instance.
{String}
getPreferencesAsText()
Return the preferences of the DataWidget instance as Text.
{Document}
getRenderer()
Retrieve the DataWidget JavaScript renderer associated to the template.
{Document}
getTemplate()
Return the DataWidget template used to create the DataWidget instance.
{String}
getTemplateName()
Return the name of the DataWidget template used to create the DataWidget instance.
{String}
getTitle()
Return the title of the DataWidget instance.
{String}
getTitleVisibility()
Return a String value ("true" or "false") that defines if the DataWidget's title bar is visible.
{Document}
getWidgetClass()
Return the DataWidget class associated to the DataWidget instance.
{String}
getWidgetClassName()
Return the name of the DataWidget class associated to the DataWidget instance.
{int}
getWidth()
Return the DataWidget width
loadData()
Retrieve Data according to a DataSource definition.
Note: This function calls automatically the DataWidget renderer after data retrieval or the callback function.
- Parameters:
- {String} callback.
- The callback function to call.
{Document}
loadTemplate()
Load the DataWidget template.
- Parameters:
- {String} template.
- The DataWidget template name.
redraw()
Clear the DataWidget and recall the renderer.
refreshData()
Retrieve Data according to a DataSource definition.
Note: This function does NOT call automatically the DataWidget renderer after data retrieval but calls a callback function.
- Parameters:
- {String} callback.
- The callback function to call.
reload()
Clear the DataWidget preferences and reload the DataWidget content (implies a reload of preferences).
savePreferences()
Save preferences of the DataWidget.
- Parameters:
- {String} callback.
- A Callback function.
setBackgroundColor()
Define the DataWidget background color.
- Parameters:
- {String} backgroundColor.
- The new background color of the DataWidget.
setBorderColor()
Define the DataWidget border color.
- Parameters:
- {String} borderColor.
- The new border color of the DataWidget.
setBorderVisibility()
Define if the DataWidget border is visible.
- Parameters:
- {String} borderVisibility.
- The new visibility status of the DataWidget border.
setData()
Set the Data to be displayed by the DataWidget. Usually, the data results from the DataSource execution.
- Parameters:
- {Document} data.
- The document object related to the data.
setDataAsText()
Set the Data as Text to be displayed by the DataWidget. Usually, the data results from the DataSource execution.
- Parameters:
- {String} dataAsText.
- The text related to the data.
setDataSourceName()
Set the DataSource name.
- Parameters:
- {String} dataSourceName.
- The DataSource name.
setDataSourceParameter()
Set the value of one of the DataSource parameters used by the DataWidget when executing the DataSource.
- Parameters:
- {String} paramName.
- The DataSource parameter name.
- {String} paramValue.
- The DataSource parameter value.
setDataSourceParameters()
Set the DataSource parameters used by the DataWidget when executing the DataSource.
- Parameters:
- {Document} parameters.
- The DataSource parameters document object.
setDataSourceRequest()
Set the DataSource Request.
- Parameters:
- {String} request.
- The DataSource request (the request is added to the DataSource location+port).
setDirectory()
Attach a directory to the DataWidget
- Parameters:
- {String} directory.
- The directory name.
setDirectoryComponent()
Attach a directory component (Flex or XForms) to the DataWidget
- Parameters:
- {String} component.
- The component's reference.
setEditFieldValue()
Set an edit field value.
- Parameters:
- {String} selector.
- The path selector.
- {String} value.
- The value to set.
setHeight(int)
Set the DataWidget height
- Parameters:
- int
- newHeight. The new DataWidget's height.
setIcon()
Set the DataWidget icon image.
- Parameters:
- {String} icon.
- The new icon of the DataWidget instance.
setInstance()
Set the DataWidget instance.
- Parameters:
- {int} instance.
- The instance number of the DataWidget.
setName()
Set the DataWidget name.
- Parameters:
- {String} name.
- The new name of the DataWidget instance.
setPreference()
Set a DataWidget preference.
- Parameters:
- {String} name.
- The property name.
- {String} value.
- The property value.
setTemplate()
Set the DataWidget template.
- Parameters:
- {String} template.
- The DataWidget template name.
setTitle()
Set the DataWidget title.
- Parameters:
- {String} title.
- The new title of the DataWidget instance.
setTitleVisibility()
Define if the DataWidget title bar is visible.
- Parameters:
- {String} titleVisibility.
- The new visibility status of the DataWidget title bar.
setWidgetClassName()
Set the DataWidget class name associated to the DataWidget instance.
- Parameters:
- {String} widgetClassName.
- The DataWidget class name.
triggerEvent(String)
Trigger an Event on the DataWidget
- Parameters:
- String
- event. The event name.