Caplin Trader 5.1.0

Class: module:ct-presenter/domain/node/DealtCurrencySelectionField

module:ct-presenter/domain/node/DealtCurrencySelectionField(oFxInstrument, oDealtCurrencyopt)

new module:ct-presenter/domain/node/DealtCurrencySelectionField(oFxInstrument, oDealtCurrencyopt)

A dealt currency specific module:br-presenter/node/SelectionField intended for use in toggle switch controls which depend on a currency pair property.

The options in an instance of a DealtCurrencySelectionField are generated from the oFxInstrument that the field is constructed with, and changes if the property changes. The value of the field also changes if the options change, to the first currency in the new pair.

Extends:
Parameters:
Name Type Attributes Description
oFxInstrument module:br-presenter/property/EditableProperty

A property created with the module:ct-trading/presenter/TradeModelPropertyFactory and bound to the currency pair within the trade.

oDealtCurrency <optional>

The default value for the pair

Implements:

Extends

Members

controlName :br-presenter/property/WritableProperty

The logical control-name the selection field is being bound to — this value will appear within the name attribute if being bound to a native HTML control.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

enabled :br-presenter/property/WritableProperty

A boolean property representing whether the selection field is enabled or not.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

failureMessage :br-presenter/property/WritableProperty

A textual description of the currently failing validation message when #hasError is true.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

hasError :br-presenter/property/WritableProperty

A boolean property that is true if #value has any validation errors, and false otherwise.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

label :br-presenter/property/WritableProperty

The textual label associated with the selection field.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

options :br-presenter/node/OptionsNodeList

The current list of options the user can select from.

Type:
  • br-presenter/node/OptionsNodeList
Inherited From:

selectedOptionLabel :br-presenter/property/Property

The current text value of the selected option's label.

Type:
  • br-presenter/property/Property
Inherited From:

value :br-presenter/property/WritableProperty

The currently selected option, or potentially any string the user has entered if being displayed with a combo-box.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

visible :br-presenter/property/WritableProperty

A boolean property representing whether the selection field is visible or not.

Type:
  • br-presenter/property/WritableProperty
Inherited From:

Methods

allowInvalidSelections(bAllowInvalidSelections)

Whether the selection field displays a validation error if the selected #value is not a member of the #options array.

Invalid selections cause validation errors by default, but this may not always be the desired behaviour, for example if the SelectionField is being displayed using a combo-box, where the #options are acting merely as suggestions, rather than as the absolute set of options.

Parameters:
Name Type Description
bAllowInvalidSelections boolean

Invalid selections are allowed when set to true.

Inherited From:

automaticallyUpdateValueWhenOptionsChange(bAutomaticallyUpdate)

Whether the selection field automatically picks a new #value when the underlying #options change.

If the underlying #options change, so that the new list of #options no longer includes the currently selected #value, a validation error will be displayed by default. In some circumstances, it may make sense to have the selection field automatically pick a new value automatically.

Parameters:
Name Type Description
bAutomaticallyUpdate boolean
Inherited From:
See:

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:

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()

Inherited From:
Deprecated:
  • This method has been replaced by #removeChildListeners which recurses the node tree. Removes all listeners attached to the properties contained by this PresentationNode.

removeChildListeners()

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

Inherited From: