-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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
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.
@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
>> 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
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.
Asked: 2009-06-18 18:28:17 +0800
Seen: 293 times
Last updated: Jun 19 '09