Client-Side input validation with RAP ClientScripting

March 23, 2012 | 1 min Read

The RAP team started working on a new feature called ClientScripting. It’s still in it’s infancy and will not (yet) be part of the core framework , but its already very useable. The goal is to allow adding pieces of behavior to the client-components of RAP widgets. This makes it possible to have swift, dynamic user feedback in situations that require a certain amout of logic - so far a problematic scenario for RAP applications. It can be considered an alternative to custom widget development in many cases, and might also save some network traffic. We currently focus on the scenario of validating text input while typing, and will expand from there. Interactions between widgets are not yet possible, but is planned.

As you can test for yourself, the difference between server-side and client-side validation is quite noticeable.

When using ClientScripting, you will need to know very little JavaScript, and all API is as close to SWT as possible. The project has a wiki page with all further information you might need (including where to get the code). Note that you need RAP 1.5M6 or newer to use it. If you try it out, please consider giving some feedback, report bugs or file enhancement requests.