0

A problem about textbox data binding

asked 2009-12-29 03:33:44 +0800

seantan gravatar image seantan
24

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 !

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2009-12-31 05:53:50 +0800

robertpic71 gravatar image robertpic71
1275 1

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

link publish delete flag offensive edit

answered 2009-12-29 22:25:02 +0800

seantan gravatar image seantan
24

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);
...

link publish delete flag offensive edit

answered 2009-12-29 05:40:27 +0800

fmcypriano gravatar image fmcypriano
612 1 7
http://felipecypriano.com...

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,

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-29 03:33:44 +0800

Seen: 508 times

Last updated: Dec 31 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More