Hi wicket list.
I am trying to set the class attribute of a wicket component:
html
body
span wicket:id=label1.../span
/body
/html
public class MyPage extends WebPage {
private Label label1;
public MyPage() {
add(label1 = new Label(label1, some text));
// How do I do this v ?
Use an AttributeModifier for this:
label1.add(new AttributeModifier(class, true, new Model() {
Object getObject(Component comp) {
return Math.random()0.5 ? SomeClass : AnotherClass;
}
});
Martijn
On 2/19/06, Christian Hvid [EMAIL PROTECTED] wrote:
Hi wicket list.
I am trying
It works. Perfect.
On 19 Feb 2006, at 14:51, Martijn Dashorst wrote:
Use an AttributeModifier for this:
label1.add(new AttributeModifier(class, true, new Model() {
Object getObject(Component comp) {
return Math.random()0.5 ? SomeClass : AnotherClass;
}
});
Martijn
On
Thanks,
I'm putting it in the book as well :-). I was busy writing and this
struck a bit of inspiration...
Martijn
On 2/19/06, Christian Hvid [EMAIL PROTECTED] wrote:
It works. Perfect.
On 19 Feb 2006, at 14:51, Martijn Dashorst wrote:
Use an AttributeModifier for this:
label1.add(new