Last modified: Mon, 04/03/2017 - 17:28
API for the MenuWidget javascript component.
Class MenuWidget
Object
|
+--MenuWidget
- class MenuWidget
Defined in MenuWidget.js
Field Summary | |
Object |
callback Callback function attached to the onChange event. |
Object |
disabled Specifies whether this widget is currently disabled. |
Object |
length Number of Options in the Select menu. |
Object |
Menu Menu object of [text,value pairs] passed in during initialization. |
Object |
selectedIndex Index of the currently selected option. |
Object |
type Select object type ['select-one' | 'select-multiple'] (currently only 'select-one' is supported) |
Object |
visible Specifies whether this widget is currently visible. |
Object |
widgetType ID string identifying this widget. |
Constructor Summary | |
MenuWidget (<object> Menu) |
Method Summary | |
void |
disable() Disables the Menu widget. |
void |
enable() Enables the Menu widget. |
int |
getSelectedIndex() Returns the selectedIndex of this MenuWidget when it is of type 'select-one'. |
string |
getValue() Returns the selected value associated with a MenuWidget of type 'select-one'. |
string |
getValues() Returns the selected values associated with a MenuWidget of type 'select-multiple'. |
void |
hide() Sets the Widget container's visibility to 'hidden'. |
void |
render(<string> element_id,<string> type) Creates the javascript Select object associated with the MenuWidget inside the named DOM element. |
void |
setCallback(callback) Sets the callback function to be attached to onChange events. |
void |
setValue(<string> value) Sets the selected Option to match the incoming value |
void |
setValueByIndex(<int> index) Sets the selected Option. |
void |
show() Sets the Widget container's visibility to 'visible'. |
Field Detail |
callback
Object callback
- Callback function attached to the onChange event.
disabled
Object disabled
- Specifies whether this widget is currently disabled.
length
Object length
- Number of Options in the Select menu.
Menu
Object Menu
- Menu object of [text,value pairs] passed in during initialization.
selectedIndex
Object selectedIndex
- Index of the currently selected option.
type
Object type
- Select object type ['select-one' | 'select-multiple'] (currently only 'select-one' is supported)
visible
Object visible
- Specifies whether this widget is currently visible.
widgetType
Object widgetType
- ID string identifying this widget.
Constructor Detail |
MenuWidget
MenuWidget(<object> Menu)
- Parameters:
Menu
- Menu object (Array of [text,value] arrays)- Returns:
- new MenuWidget object
Method Detail |
disable
void disable()
- Disables the Menu widget.
enable
void enable()
- Enables the Menu widget.
getSelectedIndex
int getSelectedIndex()
- Returns the selectedIndex of this MenuWidget when it is of type 'select-one'.
getValue
string getValue()
- Returns the selected value associated with a MenuWidget of type 'select-one'.
getValues
string getValues()
- Returns the selected values associated with a MenuWidget of type 'select-multiple'.
Currently functions identically to getValue().
hide
void hide()
- Sets the Widget container's visibility to 'hidden'.
render
void render(<string> element_id,<string> type)
- Creates the javascript Select object associated with the MenuWidget inside the named DOM element.
Any children of element_id will be removed and replaced with a Select object
- Parameters:
element_id
- 'id' attribute of the element into which the Menu is inserted.type
- javascript Select type ['select-one' | 'select-multiple']setCallback
void setCallback(callback)
- Sets the callback function to be attached to onChange events.
- Parameters:
function
- namesetValue
void setValue(<string> value)
- Sets the selected Option to match the incoming value
- Parameters:
value
- Option value to match- Throws:
- - 'Error: MenuWidgetSetValue: value [...] does not match any options.'
setValueByIndex
void setValueByIndex(<int> index)
- Sets the selected Option.
- Parameters:
index
- index into the Options array [0 <= index <= N]- Throws:
- - 'ERROR: MenuWidgetsetValueByIndex: index [...] does not match any options.'
show
void show()
- Sets the Widget container's visibility to 'visible'.