DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Info | ||
|---|---|---|
| ||
More information on the allowed property expressions can be found either in the |
A second constructor on PropertyModel is available for models that wish to access properties involving type conversions:
| Code Block |
|---|
public PropertyModel(final Object modelObject, final String expression, Class propertyType)
|
Although the property expression parser will do automatic type conversions for you, it may not always do the kind of conversion you desire. This alternative constructor creates a property model that forces a particular conversion to occur. For example, you may wish to access a String or Object property of something as an Integer. Constructing a PropertyModel with new PropertyModel(object, "myString", Integer.class) would force the property to be converted to and from an Integer on get/set operations.
Compound property models
If you have looked at some examples of Wicket already, you may have wondered why components, which generally must have a model, can be constructed with only an id, omitting any model. There are three reasons for this.
...
| Code Block |
|---|
final Person person = new Person();
person.setName("Fritzl");
Model model = new Model()
{
public Object getObject(wicket.Component component)
{
return person.getName();
}
};
add(new Label("name", model));
|
...