myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Weber <>
Subject Re: Conditional handling of list items
Date Fri, 30 Sep 2005 10:05:56 GMT

what about using two tags per item in conjunction with the rendered

<h:outputText value="#{bean.label}" rendered="#{bean.something}" />
<h:commandLink value="#{bean.label}" rendered="#{! bean.something}" />


Matthias Klein wrote:
> Is it possible to handle items in a list conditionally?
> What I mean is this:
> In my Backing Bean I have a Collection of ItemBeans.
> Each of those ItemBeans contains a boolean property such as "isSomething".
> I would now like to display this Collection through a dataTable or dataList
> of commandLinks. (The result is essentially a simple list of links)
> Thus far it's easy.
> BUT now I want to treat the items differently depending on the "isSomething"
> flag:
> All Items with the flag set "true" are supposed to be "outputText" instead
> of "commandLink" (so a User can't click on that item) and may be rendered
> with a different color.
> Is that possible? (If it is easier to tag the "special" items in a different
> way, I can do that. I am not set on the boolean isSomething property)
> Thanks
> Matt

Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

View raw message