]
Gavin King updated JBSEAM-1214:
-------------------------------
Component/s: Core
Fix Version/s: 1.3.0.BETA1
(was: 1.2.1.GA)
Affects Version/s: 1.2.1.GA
Alternate EL property reference #{entity[fieldName]} doesn't
work
-----------------------------------------------------------------
Key: JBSEAM-1214
URL:
http://jira.jboss.com/jira/browse/JBSEAM-1214
Project: JBoss Seam
Issue Type: Bug
Components: Core
Affects Versions: 1.2.1.GA
Reporter: Joshua Davis
Fix For: 1.3.0.BETA1
Validation fails for inputText fields where the value expression is of the form:
#{entity[fieldName]}
The problem is in Expressions.java, in the validate() method:
{code}
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);
}
{code}
This line is the problem:
String modelExpression = propertyExpression.substring(0, dot) + '}';
if a dot is not found, 'dot' is -1... boom!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: