I figured I'd end up having to use jQuery. I found the downside to using
jQuery is server side validation. I'm sure there must be a better way to do
this, but I found myself handling dynamic server side validation with code
like below. This uses the same db tables used in after render to set the
clientside fields. 

        String message = "You must provide a value for ";

        List<FormValidation> formValidations =
session.createCriteria(FormValidation.class)
                .add(Restrictions.eq("currentState", pr.getCurrentState()))
                .add(Restrictions.eq("applicationAction.id",
action)).list();

        for (FormValidation formValidation : formValidations) {
            FormField formField = formValidation.getFormField();

            String dbTableName = formField.getDbTableName();
            String dbTableField = formField.getDbTableField();
            String fieldName = formField.getName();

            if (DatabaseConstants.DB_TABLE_NAME_PR.equals(dbTableName)) {
                Field field = pr.getClass().getDeclaredField(dbTableField);
                field.setAccessible(true);

                if (field.get(pr) == null) {
                    form.recordError(message + fieldName);
                }
            }

As always, thanks for your input. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-client-side-validation-vs-jQuery-Validator-tp5547993p5548292.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to