It looks like http://jira.jboss.org/jira/browse/JBSEAM-580 has resurfaced.
I'm using Seam 1.2.1.GA and I get a String index out of bounds exception when I use the alternate syntax for referencing an entity property:
#{entity[fieldName]}
18:57:39,147 ERROR [STDERR] java.lang.StringIndexOutOfBoundsException: String index out of range: -1 18:57:39,148 ERROR [STDERR] at org.jboss.seam.ui.ModelValidator.validate(ModelValidator.java:32) 18:57:39,148 ERROR [STDERR] at javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:157) 18:57:39,148 ERROR [STDERR] at javax.faces.component.UIInput.validateValue(UIInput.java:312) 18:57:39,148 ERROR [STDERR] at javax.faces.component.UIInput.validate(UIInput.java:353) ...
public InvalidValue[] validate(String propertyExpression, Object value) { int dot = propertyExpression.lastIndexOf('.'); int bracket = propertyExpression.lastIndexOf('['); if (dot<=0 && bracket<=0) { return new InvalidValue[0]; } String componentName; String propertyName; if (dot>bracket) { componentName = propertyExpression.substring(2, dot); propertyName = propertyExpression.substring( dot+1, propertyExpression.length()-1 ); } else { componentName = propertyExpression.substring(2, bracket); propertyName = propertyExpression.substring( bracket+1, propertyExpression.length()-2 ); } String modelExpression = propertyExpression.substring(0, dot) + '}'; Object modelInstance = createValueBinding(modelExpression).getValue(); //TODO: cache the ValueBinding object! return getValidator(modelInstance, componentName).getPotentialInvalidValues(propertyName, value); }
This bug (http://jira.jboss.org/jira/browse/JBSEAM-1214) is fixed in Seam1.3.0.ALPHA. However this kind of reference still doesn't work in combination with <s:validate(All)> tags. There seems to be another issue with the seam validation tags as well.