You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by re...@grass-gmbh.de on 2003/09/16 15:16:30 UTC
with changing row colors
hello,
i use <logic:iterate> and want to change the cgcolor every row.
usualy i do something like this thisway:
if(currentrow mod 2 == 0)
{
bgcolor = "color1";
}
else
{
bgcolor = "color2";
}
how would u do this with struts ?
i would prefer to do this without any jsp, so far my code is "struts only"
:)
any ideas ?
Mit freundlichen Grüßen
Christian Reps, Dipl. Inf. (FH)
Web Applications
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: with changing row colors
Posted by gr...@virtual-worlds.biz.
Christian,
Not exactly struts, but you can do this using the JSTL taglibs with the
varStatus attribute, like:
<c:forEach items="${sessionScope.advertMultiEditForm.idsAsList}"
var="thisid" varStatus="stat">
<c:set var="bg" value="white" />
<c:if test="${stat.index % 2 == 0}">
<c:set var="bg" value="blue" />
<tr bgcolor="<c:out value="${bg}" />">
<td>
...
</td>
</tr>
</c:if>
</c:forEach>
or check out the display tag library at:
http://edhill.its.uiowa.edu/display/
which is great and makes this very easy.
Graham
> hello,
>
> i use <logic:iterate> and want to change the cgcolor every row.
>
> usualy i do something like this thisway:
>
> if(currentrow mod 2 == 0)
> {
> bgcolor = "color1";
> }
> else
> {
> bgcolor = "color2";
> }
>
>
> how would u do this with struts ?
> i would prefer to do this without any jsp, so far my code is "struts only"
> :)
>
> any ideas ?
>
> Mit freundlichen Grüßen
>
> Christian Reps, Dipl. Inf. (FH)
> Web Applications
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: RE : with changing row colors
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
You definitely need Niall Pemberton's row tag (from that link).
On 09/16/2003 04:55 PM thomas Sontheimer wrote:
> here are means to do it:
>
> http://husted.com/struts/FAQ/view-logic.htm
>
>
>>-----Original Message-----
>>From: reps@grass-gmbh.de [mailto:reps@grass-gmbh.de]
>>Sent: Tuesday, September 16, 2003 3:17 PM
>>To: Struts-User
>>Subject: <logic:iterate> with changing row colors
>>
>>
>>hello,
>>
>>i use <logic:iterate> and want to change the cgcolor every row.
>>
>>usualy i do something like this thisway:
>>
>>if(currentrow mod 2 == 0)
>>{
>>bgcolor = "color1";
>>}
>>else
>>{
>>bgcolor = "color2";
>>}
>>
>>
>>how would u do this with struts ?
>>i would prefer to do this without any jsp, so far my code is
>>"struts only"
>>:)
>>
>>any ideas ?
>>
>>Mit freundlichen Grüßen
>>
>>Christian Reps, Dipl. Inf. (FH)
>>Web Applications
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE : with changing row colors
Posted by thomas Sontheimer <th...@artal.fr>.
here are means to do it:
http://husted.com/struts/FAQ/view-logic.htm
> -----Original Message-----
> From: reps@grass-gmbh.de [mailto:reps@grass-gmbh.de]
> Sent: Tuesday, September 16, 2003 3:17 PM
> To: Struts-User
> Subject: <logic:iterate> with changing row colors
>
>
> hello,
>
> i use <logic:iterate> and want to change the cgcolor every row.
>
> usualy i do something like this thisway:
>
> if(currentrow mod 2 == 0)
> {
> bgcolor = "color1";
> }
> else
> {
> bgcolor = "color2";
> }
>
>
> how would u do this with struts ?
> i would prefer to do this without any jsp, so far my code is
> "struts only"
> :)
>
> any ideas ?
>
> Mit freundlichen Grüßen
>
> Christian Reps, Dipl. Inf. (FH)
> Web Applications
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org