Caplin Trader 5.1.0

Class: module:ct-presenter/property/DelayedNotificationProperty

module:ct-presenter/property/DelayedNotificationProperty(vValue)

DelayedNotificationProperty is a subclass of module:br-presenter/property/Property that will allow you to decide when to notify observers about a value change instead of having this automatically done whenever the internal value changes. In order to do this you should call the method notifyListenersIfUpdated.

Constructor

new module:ct-presenter/property/DelayedNotificationProperty(vValue)

Constructs a new DelayedNotificationProperty instance.

Extends:
Parameters:
Name Type Description
vValue Value

The property to wrap.

Extends

Methods

addChangeListener(fCallback, bNotifyImmediatelyopt)

Convenience method that allows a change listener to be added to added for objects that do not themselves implement module:br-presenter/property/PropertyListener.

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

We also allow oListener and sMethod to be used in place of fCallback, but this form is now deprecated as it's imcompatible with Closure Compiler's property renaming feature.

Parameters:
Name Type Attributes Description
fCallback function

The call-back that will be invoked each time the property changes.

bNotifyImmediately boolean <optional>

(optional) Whether to invoke the listener immediately for the current value.

Inherited From:

addFormatter(oFormatter, mConfig)

Add a module:br-presenter/formatter/Formatter that will be applied to the property before it's rendered to screen.

Any number of formatters can be added to a property, and will be applied in the same order in which the formatters were added.

Parameters:
Name Type Description
oFormatter module:br-presenter/formatter/Formatter

The formatter being added.

mConfig Object

(optional) Any additional configuration for the formatter.

Inherited From:

addListener(oListener, bNotifyImmediately)

Add a module:br-presenter/property/PropertyListener that will be notified each time the property is updated.

Parameters:
Name Type Description
oListener module:br-presenter/property/PropertyListener

The listener to be added.

bNotifyImmediately boolean

Whether to invoke the listener immediately using the current value.

Inherited From:

addUpdateListener(fCallback, bNotifyImmediately)

Convenience method that allows an update listener to be added to added for objects that do not themselves implement module:br-presenter/property/PropertyListener.

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

We also allow oListener and sMethod to be used in place of fCallback, but this form is now deprecated as it's imcompatible with Closure Compiler's property renaming feature.

Parameters:
Name Type Description
fCallback function

The call-back that will be invoked each time the property is updated.

bNotifyImmediately boolean

(optional) Whether to invoke the listener immediately for the current value.

Inherited From:

getFormattedValue()

Returns the formatted value for this property if any formatters have been attached, otherwise returns the raw property value.

Inherited From:

getPath()

Returns the path that would be required to bind this property 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:

getRenderedValue()

Returns the rendered value after applying any active formatters, otherwise returns the raw property value.

Inherited From:

getValue()

Returns the unformatted value for this property.

Inherited From:

notifyListenersIfUpdated()

Notifies observers only if an update has been received (even if the value has not changed).

removeAllListeners()

Remove all previously added module:br-presenter/property/PropertyListener instances.

Inherited From:

removeListener(oListener)

Parameters:
Name Type Description
oListener module:br-presenter/property/PropertyListener

The listener being removed.

Inherited From: