myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger (JIRA)" <>
Subject [jira] Commented: (MYFACES-141) accessing properties of an extended "List"
Date Thu, 22 Mar 2007 15:12:32 GMT


Mike Kienenberger commented on MYFACES-141:

You are better off discussing this on the mailing list rather than a closed jira issue.

The issues with "MyList" can and probably should be solved using BeanInfo to correctly configure
your bean accessors.  This might also be true for size.   

If you're using facelets (or unified EL), you can define a size function or use the jstl:length()

> accessing properties of an extended "List"
> ------------------------------------------
>                 Key: MYFACES-141
>                 URL:
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.0.9m9
>         Environment: JBoss 4.0.1sp1, my-faces-1.0.9
>            Reporter: Joerg Flammiger
> If a class "MyList" extends the class "ArrayList" and the class "MyList" has various
getter and setter methods, then it is not possible to access such properties in the jsp/jsf
page. an example expression is: #{sampleBean.testList.testValue} . the expression resolver
think "testValue" is an index; therefore, it tries to convert "testValue" to an integer, which
will fail. In my opinion, "testValue" should refer to the implemented methods "getTestValue"
and "setTestValue".
> You will get the following exception:
> 2005-03-21 15:58:12,312 ERROR [org.apache.myfaces.el.ValueBindingImpl] Cannot get value
for expression '#{sampleBean.testList.testValue}'
> javax.faces.el.ReferenceSyntaxException: Cannot convert index to int for base mypackage.MyList
and index maxItems
> 	at org.apache.myfaces.el.ELParserHelper.coerceToIntegerWrapper(
> 	at org.apache.myfaces.el.ELParserHelper.toIndex(
> 	at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(
> 	at org.apache.commons.el.ComplexValue.evaluate(
> 	at org.apache.myfaces.el.ValueBindingImpl.getValue(
> 	at javax.faces.component.UIOutput.getValue(
> 	at org.apache.myfaces.renderkit.RendererUtils.getStringValue(
> 	at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderInput(
> 	at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(
> 	at javax.faces.component.UIComponentBase.encodeEnd(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message