|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Target(value={FIELD,PARAMETER,METHOD}) @Retention(value=RUNTIME) public @interface Bound
Indicates that an annotated widget should automatically be bound to a property of a data model
associated with a DataBinder
(see AutoBound
and Model
).
The annotated widget can either be a field, method or constructor parameter or a method return
value and must implement either HasText
or HasValue
. Note that a Bound
field can but does not have to be injected. The following example shows all valid use cases for
the Bound
annotation.
public class MyBean {If no property is specified, the widget is bound to the data model property with the same name as the field, parameter or method which is the target of this annotation.@Inject
@Model
private MyModel model;@Bound
private Label boundLabel = new Label();@Inject
@Bound
private TextBox injectedBoundTextBox;@Inject
public MyBean(@Bound
SomeWidget boundWidget) { this.boundWidget = boundWidget; }@Inject
public void setWidget(@Bound
SomeWidget boundWidget) { this.boundWidget = boundWidget; }@Bound
public SomeWidget getWidget() { ... } }
Optional Element Summary | |
---|---|
Class<? extends Converter> |
converter
The Converter to use when setting values on the model or widget. |
String |
property
The name of the data model property (or a property chain) to bind the widget to, following Java bean conventions. |
public abstract String property
public abstract Class<? extends Converter> converter
Converter
to use when setting values on the model or widget.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |