|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={METHOD,FIELD})
public @interface DelegateToWidgetSignals that the property value from a state class should be forwarded to the Widget of the corresponding connector instance.
When this annotation is present on a field or on a setter method, the
framework will call the corresponding setter in the Connector's Widget
instance with the current state property value whenever it has been changed.
This is happens after firing
com.vaadin.client.ConnectorHierarchyChangeEvents but before firing
any com.vaadin.client.communication.StateChangeEvent.
Take for example a state class looking like this:
public class MyComponentState extends AbstractComponentState {
@DelegateToWidget
public String myProperty;
}
Whenever myProperty is changed, the framework will call code
like this:
connector.getWidget().setMyProperty(connector.getState().myProperty);
By default, the Widget method to call is derived from the property name, but
value() in the annotation can be used to provide a custom method
name, e.g. @DelegateToWidget("someSpecialName").
| Optional Element Summary | |
|---|---|
java.lang.String |
value
Defines the name of the Widget method to call when the annotated state property has changed. |
public abstract java.lang.String value
myProperty will delegate to a method named
setMyProperty.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||