0

DataBinder - Loading data

asked 2011-09-05 02:34:26 +0800

cdurak gravatar image cdurak
3

updated 2011-09-05 02:39:02 +0800

Hi,

I have a form with multiple input boxes (the form is used for user registration) and I'm
using the DataBinder. Almost every input box has a "no empty"-constraint.

Now, there's an unwanted behaviour:
1. Enter a value into the first field and lose focus
2. Delete the value again so the field is empty and lose focus -> the constraint triggers correctly
3. Enter a value into the second field and lose focus -> the first input field resets itself to the last validated value and is no longer marked as invalid

I know there are ways to control, when to load, an when to save data. But is it possible, for this special case, to turn off
auto data-loading?

Greetings,
Chris

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-09-05 05:03:22 +0800

robertpic71 gravatar image robertpic71
1275 1

Constraints are fired during the save-when. The default for databinding save-when is "onChange". So the constraint is fired only "onChange".

Variant 1:
"@{bean.value, save-when=none}"
binder.saveAll() or binder.saveComponent() in the composer/controller

Variant 2:
"@{bean.value, save-when=saveBtn.onClick}"

Variante 3:
"@{bean.value}"
+ bnder.saveAll() or binder.saveComponent() in the composer/controller

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: 2011-09-05 02:34:26 +0800

Seen: 176 times

Last updated: Sep 05 '11

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