Alex Rivera | Logout

How do you call List.size() from a JSF 2.0 Facelets Template?

Asked 2009-08-26T03:13:56.843
9

What is the syntax for calling list.size() in a JSF 2.0 Facelets template (eg, using an h:outputText element)?

Edit
Report

2 Answers

7

Just try #{myBean.myList.size()}

answered 2010-04-27T06:40:11.797
5

It's not a problem with JSF 2.0 exactly. The JSF spec still requires a class that conforms to the bean spec. The collection classes don't do that with the .size() method. It would still have to be .getSize(). Given the need for a "standard" way to access the class values, we're not getting around that in JSF any time soon. Somebody needs to fix the collection classes.

answered 2009-08-27T18:04:05.947

Your Answer