You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by David Delbecq <de...@oma.be> on 2007/06/28 11:24:01 UTC

Expression language, testing size of collections

Hello,

i'm facing an issue with EL in JSF. I have a collection of items. I want
to render them as a table header followed by content (using tomahawk
datalist). However, i'd like to skip full table rendering if collection
is empty or null. Problem is that collections in java do not follow the
getters mecanism (size instead of getSize). Are there clean suggested
ways to do it, or will i have to create a pseudo map that does the trick
(rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?

Thanks for suggestions.


Re: Expression language, testing size of collections

Posted by Stefano Panero <st...@gmail.com>.
Thank a lot!

2007/6/28, Christopher Cudennec <Sm...@gmx.net>:
>
> Try those URLs to begin with:
>
> [1] http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html
> [2] http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
>
> Stefano Panero schrieb:
> > Hi,
> >
> > extendig subject... where I can find documentation about EL language
> > (operator...)?
> >
> > Thanks.
> >
> > 2007/6/28, Christopher Cudennec <SmutjeJim@gmx.net
> > <ma...@gmx.net>>:
> >
> >     Hi David,
> >
> >     try this EL-Expression:
> >
> >     rendered="#{not empty yourCollectionName}"
> >
> >     Cheers,
> >
> >     Christopher
> >
> >     David Delbecq schrieb:
> >     > Hello,
> >     >
> >     > i'm facing an issue with EL in JSF. I have a collection of
> >     items. I want
> >     > to render them as a table header followed by content (using
> >     tomahawk
> >     > datalist). However, i'd like to skip full table rendering if
> >     collection
> >     > is empty or null. Problem is that collections in java do not
> >     follow the
> >     > getters mecanism (size instead of getSize). Are there clean
> >     suggested
> >     > ways to do it, or will i have to create a pseudo map that does
> >     the trick
> >     > (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
> >     >
> >     > Thanks for suggestions.
> >     >
> >     >
> >     >
> >
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.476 / Virus Database: 269.9.10/875 - Release Date:
> 27.06.2007 21:08
> >
>
>

Re: Expression language, testing size of collections

Posted by Christopher Cudennec <Sm...@gmx.net>.
Try those URLs to begin with:

[1] http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html
[2] http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html

Stefano Panero schrieb:
> Hi,
>
> extendig subject... where I can find documentation about EL language 
> (operator...)?
>
> Thanks.
>
> 2007/6/28, Christopher Cudennec <SmutjeJim@gmx.net 
> <ma...@gmx.net>>:
>
>     Hi David,
>
>     try this EL-Expression:
>
>     rendered="#{not empty yourCollectionName}"
>
>     Cheers,
>
>     Christopher
>
>     David Delbecq schrieb:
>     > Hello,
>     >
>     > i'm facing an issue with EL in JSF. I have a collection of
>     items. I want
>     > to render them as a table header followed by content (using
>     tomahawk
>     > datalist). However, i'd like to skip full table rendering if
>     collection
>     > is empty or null. Problem is that collections in java do not
>     follow the
>     > getters mecanism (size instead of getSize). Are there clean
>     suggested
>     > ways to do it, or will i have to create a pseudo map that does
>     the trick
>     > (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>     >
>     > Thanks for suggestions.
>     >
>     >
>     >
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.476 / Virus Database: 269.9.10/875 - Release Date: 27.06.2007 21:08
>   


Re: Expression language, testing size of collections

Posted by Stefano Panero <st...@gmail.com>.
Hi,

extendig subject... where I can find documentation about EL language
(operator...)?

Thanks.

2007/6/28, Christopher Cudennec <Sm...@gmx.net>:
>
> Hi David,
>
> try this EL-Expression:
>
> rendered="#{not empty yourCollectionName}"
>
> Cheers,
>
> Christopher
>
> David Delbecq schrieb:
> > Hello,
> >
> > i'm facing an issue with EL in JSF. I have a collection of items. I want
> > to render them as a table header followed by content (using tomahawk
> > datalist). However, i'd like to skip full table rendering if collection
> > is empty or null. Problem is that collections in java do not follow the
> > getters mecanism (size instead of getSize). Are there clean suggested
> > ways to do it, or will i have to create a pseudo map that does the trick
> > (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
> >
> > Thanks for suggestions.
> >
> >
> >
>
>

Re: Expression language, testing size of collections

Posted by David Delbecq <de...@oma.be>.
Thanks :D

En l'instant précis du 28/06/07 11:28, Christopher Cudennec s'exprimait
en ces termes:
> Hi David,
>
> try this EL-Expression:
>
> rendered="#{not empty yourCollectionName}"
>
> Cheers,
>
> Christopher
>
> David Delbecq schrieb:
>> Hello,
>>
>> i'm facing an issue with EL in JSF. I have a collection of items. I want
>> to render them as a table header followed by content (using tomahawk
>> datalist). However, i'd like to skip full table rendering if collection
>> is empty or null. Problem is that collections in java do not follow the
>> getters mecanism (size instead of getSize). Are there clean suggested
>> ways to do it, or will i have to create a pseudo map that does the trick
>> (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>>
>> Thanks for suggestions.
>>
>>
>>   



Re: Expression language, testing size of collections

Posted by David Delbecq <de...@oma.be>.
Thanks :D

En l'instant précis du 28/06/07 11:28, Christopher Cudennec s'exprimait
en ces termes:
> Hi David,
>
> try this EL-Expression:
>
> rendered="#{not empty yourCollectionName}"
>
> Cheers,
>
> Christopher
>
> David Delbecq schrieb:
>> Hello,
>>
>> i'm facing an issue with EL in JSF. I have a collection of items. I want
>> to render them as a table header followed by content (using tomahawk
>> datalist). However, i'd like to skip full table rendering if collection
>> is empty or null. Problem is that collections in java do not follow the
>> getters mecanism (size instead of getSize). Are there clean suggested
>> ways to do it, or will i have to create a pseudo map that does the trick
>> (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>>
>> Thanks for suggestions.
>>
>>
>>   


Re: Expression language, testing size of collections

Posted by Christopher Cudennec <Sm...@gmx.net>.
Hi David,

try this EL-Expression:

rendered="#{not empty yourCollectionName}"

Cheers,

Christopher

David Delbecq schrieb:
> Hello,
>
> i'm facing an issue with EL in JSF. I have a collection of items. I want
> to render them as a table header followed by content (using tomahawk
> datalist). However, i'd like to skip full table rendering if collection
> is empty or null. Problem is that collections in java do not follow the
> getters mecanism (size instead of getSize). Are there clean suggested
> ways to do it, or will i have to create a pseudo map that does the trick
> (rendered ="#{pseudoMapBean.size[bean.someCollection] >0}") ?
>
> Thanks for suggestions.
>
>
>