@Documented @Target(value={FIELD,PARAMETER,METHOD}) @Retention(value=RUNTIME) public @interface Bound
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
,
HasValue
or TakesValue
. 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() { ... } }
Modifier and Type | Optional Element and Description |
---|---|
Class<? extends Converter> |
converter
The
Converter to use when setting values on the model or widget. |
boolean |
onKeyUp
A flag indicating whether or not the data model property should be updated
when the widget fires a
KeyUpEvent ,
in addition to the default
ValueChangeEvent . |
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.public abstract boolean onKeyUp
KeyUpEvent
,
in addition to the default
ValueChangeEvent
.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.