Hi,
I had a problem trying to set different types of value in a TextField in Vaadin 7 beta 1. I made some tests setting an ObjectProperty on the constructor, and it works fine, but it doesn’t when I use setValue.
There is a code that can explain what I’m trying to say…
VerticalLayout vl = new VerticalLayout();
final TextField component = new TextField("Component", new ObjectProperty<Integer>(20));
Button btn = new Button("SetValue");
btn.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
component.setValue(new Integer(25));
}
});
setContent(vl);
vl.addComponent(component);
vl.addComponent(btn);
If a setValue receives an object, it should receive an Integer right?
The description of the error:
Caused by: com.vaadin.data.util.converter.Converter$ConversionException: Value of type class java.lang.Integer cannot be assigned to java.lang.String