[S2] Conditional Validation (test if field is present in JSP)

2007-09-17 Thread MLENEVEUT
Hi all, We have an Action redirecting to several JSP, depending on the customer. But the forms of these JSP are different : some fields are added/removed in some JSP. So the automatic validation fails for those fields not existing in some JSP. We bypass the problem by copying the Action

Re: [S2] Conditional Validation (test if field is present in JSP)

2007-09-17 Thread cilquirm
somewhat hackish, but you can accomplish this by using expressions : #params['attrib'] != null ? attrib in ('a','list','of','values') (this is just an example stating that you can check for the existence of the variable in the parameter and then execute an expression like you normally would )

Re: [S2] Conditional Validation (test if field is present in JSP)

2007-09-17 Thread MLENEVEUT
Sorry I did'nt understand your answer. I was talking about some input/ fileds in my JSP (present in some JPS, not in others), and how to write my XML validator file, like : validators field name=myInputFieldName field-validator type=requiredstring param

Re: [S2] Conditional Validation (test if field is present in JSP)

2007-09-17 Thread cilquirm
You can manage conditionals by using expressions and fieldexpressions , so your validation below would become : field name=myInputFieldName field-validator type=fieldexpression (#params['myInputFieldName'] neq null) ( myInputFieldName neq null