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 vvvvv ?

    if (Math.random() > 0.5) label1.setStyleClass("SomeClass");
    else label1.setStyleClass("AnotherClass");

    // ???
  }
}

I want it to render as either:

<html>
<body>
<span class="SomeClass">some text</span>
</body>
</html>

or:

<html>
<body>
<span class="AnotherClass">some text</span>
</body>
</html>

Can anyone help?

Thanks in advance.

And thanks for a good looking web framework.

-- Christian



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to