-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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
Asked: 2014-03-26 13:57:27 +0800
Seen: 27 times
Last updated: Sep 14 '14