applyViewPreset
Applies the provided preset properties to this object.
applyViewPreset(preset: {}): void
Summary
This method is called from the constructor of preset view classes, e.g. the result of ui.label(...)
and ViewComposite.withPreset(). The provided object may contain property values, bindings, and event specifiers.
Property values — These are set directly on the view object. Each property is set to the corresponding value.
Bindings — These are applied on properties the view object. Each property may be bound using an instance of the Binding class (i.e. the result of bound() functions), creating the target property and taking effect immediately.
Events — Events can be handled in two ways, depending on the value of the on...
property:
onClick: "RemoveItem"
— this interceptsClick
events and emitsRemoveItem
events instead. The ManagedEvent.inner property is set to the originalClick
event.onClick: "+RemoveItem"
— this interceptsClick
events and emits both the originalClick
event as well as a newRemoveItem
event. The ManagedEvent.inner property of the second event refers to the originalClick
event.
Note
This method is called automatically. Do not call this method after constructing a view object.
Related
- class View abstractAn abstract class that represents a view.