Hi to all the Vaaders,
Here is my question, i hope some of you will have an answer :
Why select.getValue() or textfield.getValue() returns an Object instead of a String ?
What kind of other objects can be returned by a textfield ?
Eric
Hi to all the Vaaders,
Here is my question, i hope some of you will have an answer :
Why select.getValue() or textfield.getValue() returns an Object instead of a String ?
What kind of other objects can be returned by a textfield ?
Eric
Hi,
the reason is that the getValue() method is overridden from the Property interface, which is implemented e.g. by basically all the value-having UI components in Vaadin. In some cases the value may be an array, or a Date etc. That’s why the Property interface also has a method called getType() which returns the class with which the value returned by getValue() must be compatible with. For a TextField, getType() should return String.class.
-tepi