1

Need validation for checkbox, radio, listbox

asked 2014-03-26 13:57:27 +0800

abpa gravatar image abpa
11 1

updated 2014-03-26 15:09:24 +0800

sitansu gravatar image sitansu
2254 13
http://java91.blogspot.in...

Hi ZK team,

We are in process of customizing a few ZK components to make them behave as what our business partners need. For instance, I have already prepared a new textbox that instead of showing the error bubbles, it shows the error as a red label under the textbox and it works great.

However, we need validation on components such as list box and radio button and check box. For example, in order to continue with submitting a application form, select box A can only have value X, otherwise we should show an error below that select box saying that "you are not eligible for this".

I have searched a lot in the ZK source codes and even in your forums, etc. and as I understand only InputWidget components can receive the error event from the server side and Widget components are unable to do so.

The way that we add the error messages on the server side is:

addInvalidMessage(ctx, ctx.getProperty().getProperty(), "error message");

And for my extended textbox on the client side, I am using these functions:

_markError: function (msg, val, noOnError)

and

clearErrorMessage: function (revalidate, remainError)

and

showError_: function (msg)

Now my question is, is there any way that we can make a Widget (for example a check box or a radio button) receive these error messages on the client side? even if it requires a trick.

Thank you very much in advance!

-Sami

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-09-14 11:56:18 +0800

Darksu gravatar image Darksu
1991 1 4

Hello abpa,

In the post given below, there is a code sample, that provides a solution to your problem.

http://forum.zkoss.org/question/85350/how-to-do-listbox-contraintvalidation/

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-03-26 13:57:27 +0800

Seen: 26 times

Last updated: Sep 14 '14

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