or just overide newitem(), see OddEvenItem and how datatable does it.
-igor
On Wed, Mar 19, 2008 at 4:39 PM, djo.mos <[EMAIL PROTECTED]> wrote:
>
>
>
> vincent Renaville-2 wrote:
> >
> > Hello,
> >
> > I try to display a application a table with odd line in red and even line
> > in
> > blue.
> > For each cell of the table I use a label.
> >
> > Somebody know how can I set the color to a label.
> >
> > Thanks for your help
> >
> > Vincent
> >
> >
> Hello,
> I assume that you are using a ListView for iterating over a list and
> repeating a tr elment in your HTML.
> Assuming that you have two css classes : evenLine and oddLine.
>
> Striping the table is as simple as adding this to your populateItem
> method:
>
>
>
> > if (item.getIndex() % 2 == 1) {
> > item.add(new AttributeModifier("class", true, new Model("oddRow")));
> > } else {
> > item.add(new AttributeModifier("class", true, new Model("evenRow")));
> > }
> >
>
> Cheers.
> --
> View this message in context:
> http://www.nabble.com/Set-a-dynamic-color-to-a-label-tp16158028p16162946.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]