Set a dynamic color to a label

2008-03-19 Thread vincent Renaville
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

Re: Set a dynamic color to a label

2008-03-19 Thread James Carman
Use css. If you're using a ListView, the ListItem has a getIndex() method that you can use to see if it's odd or even. On 3/19/08, vincent Renaville [EMAIL PROTECTED] 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

Re: Set a dynamic color to a label

2008-03-19 Thread Martin Makundi
You should specify separate css classes for the odd and the even labels: public class CSSClass extends AttributeModifier { public CSSClass(final String clazz) { super(class, true, new AbstractReadOnlyModel() { /** */ private static final long serialVersionUID = 1L;

Re: Set a dynamic color to a label

2008-03-19 Thread James Carman
I would probably use a helper method, along with AttributeAppender instead of creating an entirely new class for this: On 3/19/08, Martin Makundi [EMAIL PROTECTED] wrote: You should specify separate css classes for the odd and the even labels: public class CSSClass extends AttributeModifier {

Re: Set a dynamic color to a label

2008-03-19 Thread djo.mos
, 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

Re: Set a dynamic color to a label

2008-03-19 Thread Igor Vaynberg
))); } 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