I’v read the book on the part speaking about the Form and I want to know if it’s possible to use vaadin Form with a kind of dynamic JavaBean.
Assume I want to use this item :
/** A simple JavaBean. */
public class PersonBean {
String name;
String city;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setCity(String city) {
this.city = city;
}
public String getCity() {
return city;
}
}
This is a fixed JavaBean !
Now I want to use a kind of javabean defined like that :
public class PersonBean {
List<Field>
}
where Field is defined like that
public class Field{
String Type
String Data
//getters and setters ...
}
Is there a function In beanItem where we can add “manualy” getter and setter for each field inside a JavaBean ?
Or mayabe a workaround for this limitation …
public class ChampsItem extends Champs implements Item{
@Override
public boolean addItemProperty(Object id, Property property)
throws UnsupportedOperationException {
// TODO Auto-generated method stub
return false;
}
@Override
public Property getItemProperty(Object id) {
// TODO Auto-generated method stub
return null;
}
@Override
public Collection<?> getItemPropertyIds() {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean removeItemProperty(Object id)
throws UnsupportedOperationException {
// TODO Auto-generated method stub
return false;
}
}
where “Champs” is my own JavaBean
I will try to manage myself to use this Item, but I think the logical databinding of vaadin is more difficult to understand than using it in a standard way (as described in the book)
by the way, all the remaining explainations in the book are well performed !