Client-side conversion and validation
There are a number of ways by which the Trinidad framework can enhance the interactivity and improve the performance of a JSF web application. One of those ways is through the use of client-side form validation. This concept is not new, and there are many JavaScript examples on the Internet that demonstrate how to convert and validate form fields in the browser before the form data is submitted to the server.
What is interesting is how easy it is to enable client-side form conversion and validation for built-in components using the Trinidad framework. Trinidad also allows us to create our own custom client-side converters and validators through a set of Java and JavaScript interfaces. Let's look at how to enable client-side conversion and validation for built-in Trinidad components.
Enabling client-side validation in trinidad-config.xml
To demonstrate, all we have to do is add a single XML element to our trinidad-config.xml
file. This file is where a...