0

How to show all popup zk error message at once

asked 2010-03-03 23:22:13 +0800

Thiru gravatar image Thiru
147 5

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

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-03-07 20:48:59 +0800

PeterKuo gravatar image PeterKuo
481 2

updated 2010-03-07 20:49:19 +0800

You may throw new WrongValueException() to each component by using for loop.

link publish delete flag offensive edit

answered 2010-03-07 22:31:55 +0800

Thiru gravatar image Thiru
147 5

Thank You PeterKuo,

when we tried to throw new WrongValueException() for the first component along executing , the loop will not continue once thrown WrongValueException,

link publish delete flag offensive edit

answered 2010-03-08 08:11:00 +0800

madruga0315 gravatar image madruga0315 flag of Brazil
937 2 12

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());

link publish delete flag offensive edit

answered 2010-03-30 05:48:15 +0800

Thiru gravatar image Thiru
147 5

Thank You Madruga,

WrongValuesException is available from zk 3.6.0, currently we are using zk3.5.6, we'll use your valuable inputs while upgrading the application to zk higher version.

regards,
Thiru

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: 2010-03-03 23:22:13 +0800

Seen: 1,360 times

Last updated: Mar 30 '10

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