Eric13
(Eric Roberge)
September 3, 2011, 1:35am
1
Hi,
I have a TextField and a Button on on VerticalLayout.
The textField is bind like this in the constructor :
textField = new TextField(this.personItem.getItemProperty("firstName"));
When I click on my button I want to update the textField with a new BeanItem, so I do the following in the button listener :
textField.setPropertyDataSource(personItem.getItemProperty("firstName"));
When tested, my TextField is not updated at all.
am I missing something to update the UI ?
Thanks
Éric
Marko1
(Marko Grönroos)
September 3, 2011, 11:30am
2
Hi,
It should work like that. Rebinding a field to another source should cause it to update to the value of the new source accordingly. Perhaps the problem is with something else? Showing a bit more of the code might be useful.
Eric13
(Eric Roberge)
September 3, 2011, 1:40pm
3
Thanks for your quick answer.
I resolve the issue this morning.
I was passing the same data on the click listener
My bad.
Sorry
Eduardo1
(Eduardo Frazão)
September 21, 2011, 12:18pm
4
Only a observation: Why you are doing mannually data binding?
In this case, is hard to use a form, that will do that for you?
Theres a new addon that can help you to do this bindings, without boylerplate code:
PreCreatedFieldsHelper
Changing the datasource of the form, will refresh all fields in it!
Hope that it helps!
Att,
Frazão