For anyone else that runs into this problem - it occurs because it is not permitted to
call a method of a List implementation - you can only access its index. The following
example will fail with the error mentioned previously.
E.g. SummingList.java
| public class SummingList extends ArrayList<Integer> {
| ...
| public Long getSum() {
| Long sum = 0L ;
| for (Integer value : this) {
| if (value != null) {
| sum += value ;
| }
| }
| return sum ;
| }
| ...
| }
|
SummingList.xhtml
| ...
| <h:outputText value ="#{summingList.sum}" />
| ...
|
The workaround is to move the extra functionality to outside the list, e.g.
| public class SummingList {
|
| public void setList(List<Integer> list) {...}
| public List<Integer> getList() {...}
|
| public Long getSum() {...}
|
| }
|
This looks like a facelets bug/ strange implementation choice to me:
LegacyELContext.java extract:
| /* Line 137*/ if((base instanceof List) || base.getClass().isArray())
| /* Line 138*/ return getPropertyResolver().getValue(base,
Integer.parseInt(property.toString()));
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024664#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...