-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Dear All,
I have one form for example name, emailid, phone number, i have written contraint as not null for all, it is working fine on blur of each component,
my requirement is if user is clicking submit directly with out entering any value, i want to show all the constraint messages below to each of components, how it is possible
Thanks & Regards
Thiru
You may throw new WrongValueException() to each component by using for loop.
Lets say all your components are inside a array, then you'll have to go like this (warning pseudo code not tested probably buggy/error cause I'm used to groovy now and not java):
List wves = new LinkedList(); for(component in components) { try { component.getValue(); } catch (WrongValueException wve) { wves.add(wve); } } // throwing all the errors at same time throw new WrongValuesException(wves.toArray());
Asked: 2010-03-03 23:22:13 +0800
Seen: 1,360 times
Last updated: Mar 30 '10