Constructor
new module:br/presenter/property/WritableProperty(vValue)
WritableProperty instance.
Extends:
Parameters:
| Name | Type | Description |
|---|---|---|
vValue |
Object | (optional) The default value for this property. |
Extends
Methods
-
addChangeListener(oListener, sMethod, 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 whenmodule:br/presenter/property/PropertyListener#onPropertyChangedfires, and will not be notified if any of the othermodule:br/presenter/property/PropertyListenercall-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple properties.Parameters:
Name Type Attributes Description oListenerObject The listener to be added. sMethodString The name of the method on the listener that will be invoked each time the property changes. bNotifyImmediatelyboolean <optional>
(optional) Whether to invoke the listener immediately for the current value. -
addFormatter(oFormatter, mConfig)
-
Add a
module:br/presenter/formatter/Formatterthat 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 oFormattermodule:br/presenter/formatter/Formatter The formatter being added. mConfigObject (optional) Any additional configuration for the formatter. - Inherited From:
- Source:
-
addListener(oListener, bNotifyImmediately)
-
Add a
module:br/presenter/property/PropertyListenerthat will be notified each time the property is updated.Parameters:
Name Type Description oListenermodule:br/presenter/property/PropertyListener The listener to be added. bNotifyImmediatelyboolean Whether to invoke the listener immediately using the current value. - Inherited From:
- Source:
-
addUpdateListener(oListener, sMethod, 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 whenmodule:br/presenter/property/PropertyListener#onPropertyUpdatedfires, and will not be notified if any of the othermodule:br/presenter/property/PropertyListenercall-backs fire. The advantage to using this method is that objects can choose to listen to call-back events on multiple properties.Parameters:
Name Type Description oListenerObject The listener to be added. sMethodString The name of the method on the listener that will be invoked each time the property changes. bNotifyImmediatelyboolean (optional) Whether to invoke the listener immediately for the current value. -
getFormattedValue()
-
Returns the formatted value for this property if any formatters have been attached, otherwise returns the raw property value.
-
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:
- Source:
-
getRenderedValue()
-
Returns the rendered value after applying any active formatters, otherwise returns the raw property value.
-
getValue()
-
Returns the unformatted value for this property.
- Inherited From:
- Source:
-
removeAllListeners()
-
Remove all previously added
module:br/presenter/property/PropertyListenerinstances. -
removeListener(oListener)
-
Remove a previously added
module:br/presenter/property/PropertyListener.Parameters:
Name Type Description oListenermodule:br/presenter/property/PropertyListener The listener being removed. -
setValue(vValue)
-
Sets the unformatted value for this property and notifies listeners of the change.
This method is called from the presentation model only, and does not allow user editable controls to be bound from the view.
Parameters:
Name Type Description vValueVariant The new value for this property.