myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Weber <vol...@weber-oldenburg.de>
Subject Re: AW: Using JSTL in JSF Datatable
Date Tue, 27 Sep 2005 14:43:00 GMT
Hi,

as i understood the type of rowItem is a list and in the 9'th element is
the status he will use get the color.

So i think the question must be : which type is the 9'th element ofh the
list.

and you can use somethink like

<h:graphicImage value="/images/ampel_green.gif" height="15" width="15"
    rendered="#{rowItem[9] == 1}"/>
<h:graphicImage value="/images/ampel_red.gif" height="15" width="15"
    rendered="#{rowItem[9] != 1}"/>


Ryan Wynn wrote:
> 
> What is the type of your var rowItem in the datatable?  If this a
> javabean that you coded then you can write methods like
>         boolean isGreen
>         boolean isRed
>         etc.
> 
> Then put image tags inside the status column for each possible outcome
> and each would have a rendered attribute corresponding to the
> appropriate method like
> 
> <h:graphicImage value="/images/ampel_green.gif" height="15" width="15"
> rendered="#{rowItem.green}"/>
> <h:graphicImage value="/images/ampel_red.gif" height="15" width="15"
> rendered="#{rowItem.red}"/>
> 
> This is only possible if you have access to the type of rowItem.  If
> this is a jdbc class or something then you would need to wrap it with
> your own javabean.
> 
> 
> =======================================
> Ryan Wynn
> Websphere Portal Developer
> IBM Business Consulting Services - Public Sector
> Reston Office: 703-668-2478
> Cell:  703-622-1977
> rwynn@us.ibm.com
> 

...

-- 
-------------------------------------------------------------------------
    Volker Weber    Dietrichsweg 38a     26127 Oldenburg     Germany
    MAILTO:Volker@weber-oldenburg.de   HTTP://www.weber-oldenburg.de


Mime
View raw message