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

matthias egger commented on MYFACES-141:
----------------------------------------

yep, sorry for posting on the wrong place (i felt motivated by "...Please add 
your detailed comments...");

to close this topic here:
there is indeed another better solution:

simply wrap your destined List returned by your bean in a 
javax.faces.model.DataModel:

    public DataModel getMyData() {
        DataModel listData = new ListDataModel(); // or ArrayDataModel()
        listData.setWrappedData(some array);
        return listData;
    }

accessing on the jsf page, e.g:
<t:outputText value="#{sampleBean.myData.rowCount}"  />
...

but anyway thanks for your prompt reply.


> 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.

Reply via email to