This content has been marked as final.
Show 6 replies
-
1. Re: Can I really not get the size of a list in JSF?!
robjellinghaus Jan 27, 2006 3:07 AM (in response to robjellinghaus)I went ahead and added ListDataModel.getSize() and it works like a champ:
public int getSize () { return ((List)getWrappedData()).size(); }
Now I can do #{blogPosts.size} as I originally wanted.
How about it, Gavin? Post-beta-2 is fine with me, I'm not putting this thing into production aaaaanytime soon (it's my personal project, which means it's moving slowly)....
Cheers!
Rob -
2. Re: Can I really not get the size of a list in JSF?!
gavin.king Jan 27, 2006 10:05 AM (in response to robjellinghaus)Use: #{blogPosts.rowCount}
-
3. Re: Can I really not get the size of a list in JSF?!
robjellinghaus Jan 27, 2006 8:12 PM (in response to robjellinghaus):-P
Should have seen that one myself. Oh well, at least it was educational.... -
4. Re: Can I really not get the size of a list in JSF?!
vqminh Jun 8, 2006 3:05 PM (in response to robjellinghaus)what if I cannot outject it as datamodel, for example, I want to get the size of the List?
Thanks -
5. Re: Can I really not get the size of a list in JSF?!
vqminh Jun 8, 2006 3:06 PM (in response to robjellinghaus)I mean the List of SelectItems
-
6. Re: Can I really not get the size of a list in JSF?!
cptnkirk Jun 8, 2006 4:19 PM (in response to robjellinghaus)If you're using Facelets, it's pretty easy to write an EL function to do this.
#{fn:sizeOf(myCollection)}
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-create-function
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-function