Hi!
I was trying to solve the problem of replacing a specific css class of a
wicket component with another css class. Google pointed me to the
following thread:
http://apache-wicket.1842946.n4.nabble.com/How-to-add-and-remove-css-classes-the-right-way-td1868408.html
The nice and simple solution was something like this:
String oldCss = String.valueOf(this.getMarkupAttributes().get("class"));
String newCss = oldCss.replaceFirst("old", "new");
new SimpleAttributeModifier("class", newCss);
I've used it and it works just fine.
Unfortunately - as I've just found out - the method
getMarkupAttributes() has the following javadoc:
"THIS IS WICKET INTERNAL ONLY. DO NOT USE IT."
If I'm not supposed to use getMarkupAttributes(), what would be the
correct way then to get the current css classes of a wicket component?
Cheers,
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]