(I guess that this is an enhancement request...)
The valang syntax is:
{ <key> : <predicate_expression> : <message> [: <error_code> [: <args> ]] }
The docs say:
"...binds the rule predicates to a key (usually a bean property)"
I have make a rule that says "either any one of these (3) fields contains data, or the 'anonymous' property == true". It looks like:
This works fine but is rather inelegant.Code:{ firstName : ((title HAS TEXT) OR (firstName HAS TEXT) OR (surname HAS TEXT)) OR (anonymous == TRUE) : 'NAME!' : 'contactDetailsCheck.specified.title.field.required' }
My issue is that the <key> part does NOT refer to a bean property. In this case the rule refers to 4 properties.
I'd LIKE to say:
Where 'allOrPartNameGiven' is NOT a bean property.Code:{ allOrPartNameGiven : ((title HAS TEXT) OR (firstName HAS TEXT) OR (surname HAS TEXT)) OR (anonymous == TRUE) : 'NAME!' : 'contactDetailsCheck.specified.name.fields.required' }
At the moment, I get an exception along the lines of:
Thoughts?Code:org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@1dc7a0d targetAction = org.springframework.webflow.action.FormAction@19a485f, attributes = map['method' -> 'bindAndValidate']] in state 'contactDetailsCheck' of flow 'tceScriptFlow' -- action execution attributes were 'map['method' -> 'bindAndValidate']'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'nameStuff' of bean class [au.com.sparq.tce.web.ContactDetailsCheckActionObject]: Bean property 'nameStuff' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'nameStuff' of bean class [au.com.sparq.tce.web.ContactDetailsCheckActionObject]: Bean property 'nameStuff' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:510) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:502)
Cheers,
Alph


