Frameworks
ZK Framework
ZK-Framework - Creating the Pages
Menu Page with Result Page
Redesigned Page
Store data in model classes
Validations
Complete Implementation
Adding textbox component
Toolbarbutton componentThe field id is extended with two validations. The first validation is done while the user inserts some input into the field. For that we provided some code for the onChanging handler. If the user types only white spaces there is the warning not valid on the right side. Otherwise the green note valid is presented.
Sponsored Links{qbacode language=XML}
The next validation is done in the onChange handler.
{qbacode language=XML}
We use the possibility to throw a org.zkoss.zk.ui.WrongValueException. If this exception occurs the framework shows an error message linked to the concerned field. The following figure shows such an error message.

Sponsored Links
NOTE: It's important to say that the code in an event handler or a zscript must bevalid XML, because a ZUL page is an XML page. Here, we are confronted with the problem of using some special characters (e.g. & or <). We have two possibilities to use such characters. The first is to use valid XML entities (e.g. && for &&) or we can embed the code in a CDATA block (<![CDATA[ ? ]]>). For more readable code it's recommended to use the CDATA block variant.
Next Page: Complete Implementation
| Comments |
|---|