myfaces-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/MYFACES-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12483177
] 

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()
function.



> accessing properties of an extended "List"
> ------------------------------------------
>
>                 Key: MYFACES-141
>                 URL: https://issues.apache.org/jira/browse/MYFACES-141
>             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(ELParserHelper.java:418)
> 	at org.apache.myfaces.el.ELParserHelper.toIndex(ELParserHelper.java:440)
> 	at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:541)
> 	at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> 	at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:441)
> 	at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
> 	at org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:293)
> 	at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderInput(HtmlTextRendererBase.java:159)
> 	at org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:77)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:332)

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


Mime
View raw message