new module:ct-trading /presenter /Trade Model Property Factory(oTrade Model)
Construct a new instance of TradeModelPropertyFactory
, bound to the given module:ct-trading/trademodel/Trade
instance.
Class that can be used to provide instances of module:br-presenter/property/Property
or
module:br-presenter/property/EditableProperty
, but where the value of the property is
bound to an underlying trade model object.
This class allows the trade model object that the created properties are bound to to be dynamically updated without any interruption in service.
Parameters:
Name | Type | Description |
---|---|---|
oTradeModel |
module:ct-trading |
The trade model instance that all created properties will be bound to. |
Methods
destroy()
Removes all listeners, and performs any necessary clean-up when the properties created by this factory are no longer needed.
get Editable Property(sPath)
Returns a new module:br-presenter/property/EditableProperty
instance bound to the specified
part of the trade model.
Parameters:
Name | Type | Description |
---|---|---|
sPath |
String | the path to the property on the |
get Property(sPath)
Returns a new module:br-presenter/property/Property
instance bound to the specified
part of the trade model.
Parameters:
Name | Type | Description |
---|---|---|
sPath |
String | the path to the property on the Trade object |
get Trade()
Returns the trade model instance that all properties created by this factory are bound to.
get Trade Leg Factory(nLeg Index, FTrade Model Property Factoryopt)
Returns a new name-spaced instance of TradeModelPropertyFactory
(or
FTradeModelPropertyFactory
if you pass it to the method) where the specified trade leg acts as the
root element for any calls to module:ct-trading/presenter/TradeModelPropertyFactory#getProperty
and module:ct-trading/presenter/TradeModelPropertyFactory#getEditableProperty
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
nLegIndex |
int | The index of the leg that will become the new root object. |
|
FTradeModelPropertyFactory |
function |
<optional> |
The TradeModelPropertyFactory constructor that should be
used, uses |
- Deprecated:
- This method is deprecated. Use
module:ct-trading/presenter/TradeModelPropertyFactory#getTradeLegFactoryById
.
- This method is deprecated. Use
Returns:
a new instance of module:ct-trading/presenter/TradeModelPropertyFactory
or a new instance of
FTradeModelPropertyFactory
if provided.
get Trade Leg Factory ById(nLeg Id, FTrade Model Property Factoryopt)
Returns a new name-spaced instance of TradeModelPropertyFactory
(or FTradeModelPropertyFactory
if you pass it to the method) where the
specified trade leg acts as the root element for any calls to module:ct-trading/presenter/TradeModelPropertyFactory#getProperty
and
module:ct-trading/presenter/TradeModelPropertyFactory#getEditableProperty
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
nLegId |
int | The ID of the leg that will become the new root object. |
|
FTradeModelPropertyFactory |
function |
<optional> |
The TradeModelPropertyFactory
constructor that should be used, uses |
Returns:
a new instance of module:ct-trading/presenter/TradeModelPropertyFactory
or a new
instance of FTradeModelPropertyFactory
if provided.
get Trade State Property()
Returns a new module:br-presenter/property/Property
instance bound to the overall state
of the trade.
set Trade(oModel)
Replaces the Trade
object referenced by the TradeModelPropertyFactory
and causes
all pre-existing properties to also be updated so that they reference this new Trade
.
Parameters:
Name | Type | Description |
---|---|---|
oModel |
module:ct-trading |
The new trade model object that all properties will now be bound to. |