Caplin Trader 4.0.3

Class: module:br/presenter/node/OptionsNodeList

module:br/presenter/node/OptionsNodeList

Summary

The OptionsNodeList class is used to store the options available within module:br/presenter/node/SelectionField and br/presenter/node/MultiSelectionField instances.

Constructor

new module:br/presenter/node/OptionsNodeList(vOptions)

Constructs a new OptionsNodeList instance.
Parameters:
Name Type Description
vOptions Object The set of available options, either as an array (keys only) or a map (keys to label).

Extends

Methods

addChangeListener(oListener, sMethod, bNotifyImmediately)

Convenience method that allows listeners to be added for objects that do not themselves implement module:br/presenter/node/NodeListListener.

Listeners added using addChangeListener() will only be notified when module:br/presenter/node/NodeListListener#onNodeListChanged fires, and will not be notified if any of the other module:br/presenter/node/NodeListListener call-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple node lists.

Parameters:
Name Type Description
oListener Object The listener to be added.
sMethod String The name of the method on the listener that will be invoked each time the property changes.
bNotifyImmediately boolean (optional) Whether to invoke the listener immediately for the current value.
Inherited From:

addListener(oListener, bNotifyImmediately)

Add a module:br/presenter/node/NodeListListener that will be notified each time the node list is updated.
Parameters:
Name Type Description
oListener module:br/presenter/node/NodeListListener The listener to be added.
bNotifyImmediately boolean Whether to invoke the listener immediately using the current node list.
Inherited From:

getFirstOption() → {br.presenter.node.Option}

Retrieve the first option in the list — typically the default option.
Returns:
Type
br.presenter.node.Option

getOptionByLabel(sLabel)

Retrieve the option with the given label. (If there is more than one option which has the given label, the first instance is returned.)
Parameters:
Name Type Description
sLabel String Label to search.
Returns:

getOptionByValue(sValue, {@link)

Retrieve the option with the given unique value.
Parameters:
Name Type Description
sValue String Value to search.
{@link module:br/presenter/node/Option}

getOptionLabels() → {Array}

Retrieve an array of labels for each module:br/presenter/node/Option contained within this object.
Returns:
Type
Array

getOptions() → {Array}

Retrieve the array of module:br/presenter/node/Option instances contained by this object.
Returns:
Type
Array

getOptionValues() → {Array}

Retrieve an array of values for each module:br/presenter/node/Option contained within this object.
Returns:
Type
Array

getPath()

Returns the path that would be required to bind this node from the view.

This method is used internally, but might also be useful in allowing the dynamic construction of views for arbitrary presentation models.

Inherited From:

getPresentationNodesArray()

Returns the list of module:br/presenter/node/PresentationNode instances as an array.
Inherited From:

getTemplateForNode(oPresentationNode)

Returns the name of the template used to render the given presentation node.
Parameters:
Name Type Description
oPresentationNode module:br/presenter/node/PresentationNode The presentation node being queried.
Inherited From:

nodes(sNodeName, vProperties)

Returns all nested nodes matching the search criteria reachable from this node.

Care is taken not to search up the tree in cyclic presentation models (where some of the presentation nodes have back references to presentation nodes higher up in the tree).

Parameters:
Name Type Description
sNodeName String The name of nodes to match.
vProperties Object Only nodes having this array or map of properties will be matched.
Inherited From:
See:

properties(sPropertyName, vValue)

Returns all nested properties matching the search criteria reachable from this node.

Care is taken not to search up the tree in cyclic presentation models (where some of the presentation nodes have back references to presentation nodes higher up in the tree).

Parameters:
Name Type Description
sPropertyName String The name of properties to match.
vValue Object The value of properties to match.
Inherited From:
See:

removeAllListeners()

Remove all previously added module:br/presenter/node/NodeListListener instances.
Inherited From:

removeChildListeners()

Removes all listeners attached to the properties contained by this PresentationNode, and any nodes it contains.
Inherited From:

removeListener(oListener)

Remove a previously added module:br/presenter/node/NodeListListener.
Parameters:
Name Type Description
oListener module:br/presenter/node/NodeListListener The listener being removed.
Inherited From:

setOptions(vOptions)

Reset the list of available options using the given array or map.
Parameters:
Name Type Description
vOptions Object The set of available options, either as an array (keys only) or a map (keys to label).