Hi Naren,
This should go to the user list, too. You'll have better chances of
getting answers there. :)
http://jakarta.apache.org/site/mail2.html#Velocity
http://www.mail-archive.com/[EMAIL PROTECTED]/
# You can subscribe by sending an empty mail to
[EMAIL PROTECTED]
Also, I think most of us getting text mail can't figure out where the
"code in red" is.
Best regards,
-- Shinobu Kawai
----- Original Message -----
From: Nuggihalli,Naren <[EMAIL PROTECTED]>
Date: Mon, 4 Oct 2004 12:19:54 -0400
Subject: alternate color in jsp tags and vtl
To: Velocity Developers List <[EMAIL PROTECTED]>
Hi,
I am trying to set alternate color for the table , this is how
I used...but it never takes the color...waht am I doing wrong? see the
code in red
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tlds/fmt.tld" prefix="fmt" %>
<jsp:useBean id="populardocsbean"
class="com.gartner.wcw.servlet.PopularDocsBean"/>
<vel:velocity>
#if ($velocityCount % 2 == 1) #set($color="#fcfcfc") #else
#set($color="#fefefe") #end
</vel:velocity>
<html>
<head>
<title>EXP TOP 50</title>
</head>
<body>
<c:set target='${populardocsbean}' property='type' value='EXPUSR_WEEK'/>
<c:set var="idx" value="1"/>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<!-- Comment = 49 -->
<c:forEach var="doc" varStatus='idx'
items="${populardocsbean.list}" end="49">
<tr>
<td colspan="2"><hr size="1" width="100%" color="#F5EED3"></td>
</tr>
<vel:velocity>
<tr height="67" bgcolor="$color">
</vel:velocity>
<td width="52" class="GoldBold90"> <c:out
value="${idx.count}"/>.</td>
<td ><b><fmt:formatDate value="${doc.lastRevDt}"
pattern="d MMMMM yyyy"/></b><br>
<img src="/images/trans_pixel.gif" width="1"
height="3" border="0" alt=""><br>
<a href="/DisplayDocument?id=<c:out value="${doc.resId}"/>"
class="BoldBlueLink" target="_blank"
onClick="openResult('/DisplayDocument?id=<c:out
value="${doc.resId}"/>');
return false;"><c:out value="${doc.title}"/></a><br>
<img src="/images/trans_pixel.gif" width="1"
height="3" border="0" alt=""><br>
<c:forEach var="author" varStatus='aidx'
items="${doc.authors}">
<a href="/AnalystBiography?authorId=<c:out
value="${author.id}"/>" class="ThinBlueLink"
onClick="openBio('/AnalystBiography?authorId=<c:out
value="${author.id}"/>'); return false;"><c:out
value="${author.fullname}"/></a>
<c:if test="${not aidx.last}"><font color="#F5EED3"> |
</font></c:if>
</c:forEach></td>
</tr>
</c:forEach>
</table>
</body>
</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Shinobu Kawai([EMAIL PROTECTED])
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]