@Target(value={METHOD,FIELD}) public @interface DelegateToWidget
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").
public abstract String value
myProperty will delegate to a method named
setMyProperty.Copyright © 2017 Vaadin Ltd. All rights reserved.