0

How to force validation of all components?

asked 2009-06-18 18:28:17 +0800

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

Is there a way to force the validation of all components in a window?

When the have lots of components it's a pain to call each getValue() method.

Regards,
Felipe Cypriano

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2009-06-19 06:15:54 +0800

edudant gravatar image edudant
219 1 1 1
zk.datalite.cz

I don't know if there is a ZK method, but:

- if you use databinding, then you can call dataBinder.saveAll(); method.
- you can write generic method which will walk through component tree (comp.getChildren()) and call getValue() method

link publish delete flag offensive edit

answered 2009-06-19 06:49:57 +0800

davout gravatar image davout
1435 3 18

It's a gap in the design - there's no real recognition of a window as a form. Equally the existing constraint feature only works at the individual component level, not across a group of components.

I you post a 'ZK feature' request on this, and send me a link to it, I'll add my comments to this as well.

link publish delete flag offensive edit

answered 2009-06-19 12:59:57 +0800

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

updated 2009-06-19 13:00:28 +0800

@edudant
I tried to use binder.saveAll() but it didn't work. Now I'm coding a method that goes through all children calling getValue().

@davout
I created the feature request: ID: 2809002
Regards,
Felipe Cypriano

link publish delete flag offensive edit

answered 2009-06-19 13:29:35 +0800

robertpic71 gravatar image robertpic71
1275 1

>> I tried to use binder.saveAll() but it didn't work. Now I'm coding a method that goes through all children calling getValue().
????
Fire the contraints with binder.saveAll() is my standard-way - without any problems. What kind of UI-element you have to check? ZK Version?

/Robert

link publish delete flag offensive edit

answered 2009-06-19 14:25:24 +0800

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

I tried this code in a onClick:

searchCliente.setConstraint("no empty") // a custom macro component, which works with constraint
cmbLocalCobranca.setConstraint("no empty, strict") //  Combobox
cmbCondicaoPagamento.setConstraint("no empty, strict") // Combobox
searchTransportadora.setConstraint("no empty") // the same custom macro component as before

// page.getVariable("binder") this is caleed before
binder.saveAll()

This code doesn't throw any exceptions (WrongValueException). I'm using Zk 3.6.1

If I call the getValue() method of any of that components the constraint violation is showed.

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-06-18 18:28:17 +0800

Seen: 293 times

Last updated: Jun 19 '09

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