Hello,
We are going to be implementing server-side validations and I'm looking for some clarification.
1. If we have a custom javascript validator like the snippet below, how would we configure or write the accompanying server-side validation logic for this validator using SmartClient's Validator? Obviously, we know how to write the java to check this same validation logic. But, the goal would be to configure and write custom validation logic for both client-side and server-side in one common place such as the Datasource definition files. Can you shed any light on how that would work or point me to the releveant docs?
2. We have a separate component that runs nightly to import data into our database from external sources. We'd like to apply the same validators to this process even though it is currently not integrated at all with SmartClient. So, how would this work? Is it simply a matter of installing the SmartClient server components as part of this batch process and wiring it up to call the same validators?
3. We are investigating Hibernate validator as well (http://www.hibernate.org/412.html). Would that work as a replacement for SmartClient server-side validation or an enhancement? Or, would it just end up creating a lot of duplicate validation work?
Our ultimate goal is to have one common repository of validator logic and configuration that can be applied in several different places including custom validators for SmartClient client-side javascript, SmartClient server-side java logic, and additional components that also import data into our database.
We are going to be implementing server-side validations and I'm looking for some clarification.
1. If we have a custom javascript validator like the snippet below, how would we configure or write the accompanying server-side validation logic for this validator using SmartClient's Validator? Obviously, we know how to write the java to check this same validation logic. But, the goal would be to configure and write custom validation logic for both client-side and server-side in one common place such as the Datasource definition files. Can you shed any light on how that would work or point me to the releveant docs?
Code:
<validator type="custom" > <condition><JS><![CDATA[ function (item, validator, value) { if( item!=null && item.form!=null){ if(value==0 || value > 999 || value < -999){ return false; } } return true; } ]]></JS> </condition> <errorMessage> <spring:message code="prompt.fa.betafixvalidation"/> </errorMessage> </validator>
2. We have a separate component that runs nightly to import data into our database from external sources. We'd like to apply the same validators to this process even though it is currently not integrated at all with SmartClient. So, how would this work? Is it simply a matter of installing the SmartClient server components as part of this batch process and wiring it up to call the same validators?
3. We are investigating Hibernate validator as well (http://www.hibernate.org/412.html). Would that work as a replacement for SmartClient server-side validation or an enhancement? Or, would it just end up creating a lot of duplicate validation work?
Our ultimate goal is to have one common repository of validator logic and configuration that can be applied in several different places including custom validators for SmartClient client-side javascript, SmartClient server-side java logic, and additional components that also import data into our database.
Comment