PDA

View Full Version : Make invalid a field in a form panel



drenda81
7 Jul 2008, 11:35 AM
Hi,
can I make a field of a form panel invalid manually?
For example if I make a form panel with several TextField, then I want to test a particular condition ONLY WHEN I click on Submit button. So I can't use field.setValidator() because validation in make on focus lost, instead I want to validate a particular field only when I click on submit button.

So there is the possibility to call a method of the field as: field.setInvalid(String description) or something similar?

Thanks a lot

cgraf
7 Jul 2008, 12:26 PM
I think is

public void markInvalid(java.lang.String msg)

field.markInvalid("xxxxx")

drenda81
7 Jul 2008, 12:32 PM
Thanks cgraf,
sorry maybe I'm tired because this method is passed inobserved by me :)

Thanks!

drenda81
8 Jul 2008, 12:25 AM
Hi,
in my tests I've noticed that the markInvalid not make form invalid! Why?


Thanks