You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Bruno Aranda <br...@gmail.com> on 2006/06/02 14:15:15 UTC

Re: JSF EL List size

AFAIK, no. You have to provide a getter in your backing bean to
delegate that functionality, like this:

public getListSize()
{
   return yourList.size();
}

Or, if you are using an extended tomahawk datatable, you can use the
attribute rowCountVar (see the docs for more info [1]), that allows to
show the total number of rows in a table.

Hope that helps,

Bruno

[1] http://myfaces.apache.org/tomahawk/extDataTable.html

On 6/2/06, Furer Alexander <al...@bezeqint.net> wrote:
>
>
> Hi
> Is to possible to get List size in JSF EL ?
> Thanks

Re: JSF EL List size

Posted by Andrew Robinson <an...@gmail.com>.
Another alternative is a function with facelets

Java:
public static int sizeOf(Collection coll)
{
  return coll.size();
}

taglib.xml:
<function>
  <function-name>sizeOf</function-name>
  <function-class>yourpackage.YourClass</function-class>
  <function-signature>int sizeOf(java.util.Collection)</function-signature>
</function>

XHTML:

<t:outputText value="#{my:sizeOf(bean.list)}" />

On 6/2/06, Bruno Aranda <br...@gmail.com> wrote:
> AFAIK, no. You have to provide a getter in your backing bean to
> delegate that functionality, like this:
>
> public getListSize()
> {
>    return yourList.size();
> }
>
> Or, if you are using an extended tomahawk datatable, you can use the
> attribute rowCountVar (see the docs for more info [1]), that allows to
> show the total number of rows in a table.
>
> Hope that helps,
>
> Bruno
>
> [1] http://myfaces.apache.org/tomahawk/extDataTable.html
>
> On 6/2/06, Furer Alexander <al...@bezeqint.net> wrote:
> >
> >
> > Hi
> > Is to possible to get List size in JSF EL ?
> > Thanks
>