This content has been marked as final.
Show 3 replies
-
1. Re: how do i get the size of collection in .xhtml with facel
msduk Apr 26, 2007 7:18 AM (in response to holtak)Are you susre that your collection supports getSize() ?
Iterator and a few others do not -
2. Re: how do i get the size of collection in .xhtml with facel
pmuir Apr 26, 2007 7:32 AM (in response to holtak)Seam intercepts EL calls and adds in a size property for Collections, Map and DataModel. Does this work if your EL expression is #{myCollection.size}?
-
3. Re: how do i get the size of collection in .xhtml with facel
lindsayh Apr 26, 2007 8:19 AM (in response to holtak)"petemuir" wrote:
Seam intercepts EL calls and adds in a size property for Collections, Map and DataModel. Does this work if your EL expression is #{myCollection.size}?
I think these EL resolvers only work for JSF 1.2.
After having difficulty getting my app to work with JSF 1.2, I just use the JSTL length funtion to get a collection size when I need to:
Here's my namespace declaration:<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:s="http://jboss.com/products/seam/taglib" ... xmlns:jstlfn="http://java.sun.com/jsp/jstl/functions" ...
and here's how I use the length function in a table:<rich:column> <f:facet name="header"> No. of Users </f:facet> #{jstlfn:length(userGroup.users)} </rich:column>
I got this tip from someone else.
Lindsay