-
FEATURED COMPONENTS
First time here? Check out the FAQ!
data binding works well when I key the value into the textbox control, but not works when I call the setValue() method in back bean. Why?
please give me a favor. thanks !
If you mean after you call setValue() the textbox isn't automatically updated, it's because the binding mechanism can't possible know that the model has changed.
Read this thread to learn more about how to use binder.
Regards,
fmcypriano, thanks for you reply.
I have found the answer!
Because the settext() method do not trigger the data binding actions, so when I added code below the problem has fixed.
...
textbox.setText("xxx");
Events.sendEvent(new Event(Events.ON_CHANGE,textbox);
...
Hi seantan,
you have an resolution, but i prefer a other way to load binding data.
1. the the databinder instance
2. use the binder for extra load
binder.loadAll(); // reload all fields
binder.load(component); // reload all bindings from this component and below
<grid id="detailview">
...
<label value="@{win$composer.value1}"/>
..
</grid>
Component detailview; // autowired
...
binder.load(detailview);
Check here some databinding examples
/Robert
Asked: 2009-12-29 03:33:44 +0800
Seen: 508 times
Last updated: Dec 31 '09