Subject: Re: how to get the index in tapestry loop and change background color of a table
On Wed, 22 Feb 2012 04:31:51 -0200, karthi <rathinasamy.r.s@xxxxxxxxxxxxx> wrote:

Hi,

Hi!

Have you ever read the Loop documentation? There's an index parameter there.

<t:loop t:index="index" ...>
<p style="${pStyle}">

@Property
private int index;

public String getStyle() {

if (index%2 == 0) {
return "background-color: #CDCECC";
} else {
return="background-color: #FFFFFF"
}

}

Please read the documentation before posting questions. It'll save yours and ours time.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da InformaÃÃo Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxxxx

(C)2011 mailinglist-archive.com