You can either include an img tag directly in the JSP markup, or use CSS to 'inject' the images. The first way, you'll need to specify the image and, since you're overriding the default cell value, you'll need to also include the text part:

    <displayTag:column property="state" ...>
        <img src="..."/><%= row.getState() %>
    </displayTag:column>

(assuming you have id="row" on your enclosing 'table' tag). The second way, you'd just specify the CSS class in the JSP, for example:

<displayTag:column property="state" ... class='<% "state" + row.getState() %>' />

Then add CSS like

#state0 { background: url('/path/to/red.gif') center left; padding-right: 10px; } #state1 { background: url('/path/to/yellow.gif') center left; padding-right: 10px; } #state2 { background: url('/path/to/green.gif') center left; padding-right: 10px; }

HTH,

L.

On 19-Sep-05, at 2:30 AM, Yanet wrote:

I am new using displaytag.. so
i would like to know is it posible to show images beside values.. i.e
<displayTag:column property="state"
title="State"
paramId="datastate"
sortable="true"
headerClass="sortable"  />

property="state", state can be 0, 1 or 2..beside those values.. i want to show
images like red.gif, yellow.gif, green.gif.

thanks.. in advance. i will appreciatte your helps.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user


--
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to