In Facelets, you can use the jstl:length() function -- you don't have
to create your own function.
xmlns:jstl="http://java.sun.com/jsp/jstl/functions"
rendered="#{jstl:length(list) gt 0 and
page.limit eq jstl:length(list)}"
Note that you can also use "#{empty list}" for comparing for 0 items
-- just discovered this recently.
On 12/19/06, David Delbecq <[EMAIL PROTECTED]> wrote:
Hello,
i'd like, in jsf to print a statement like this:
You have #{someBean.someArray.size} item(s) just before a facelets
c:forEach.
example:
You have 28 item(s): item1, item2, item3, ... (get full list of items)
While i can do the partial iteration without problem, i am wondering how
to the array size (Or in more general, any collection size)
I'd like to avoid creation of a method someBean.getSomeArraySize() as
it's seems to me it's like doing double work (getSommeArray returns and
array and getSommeArray returns information present in Array)