You can also use an AttributeModifier, which will give you the old value (as I recall).
overriding the method onComponentTag(ComponentTag tag), will let you easily put a new variable for your class etc... but you will need to use tag.get(), and tag.put(tag.get("")+"..."). Looks somewhat messy when you start using StringBuffers, unless your doing a lot of tag modifications might as well use AttributeModifier. In fact use, SimpleAttributeModifier: component.add(new SimpleAttributeModifier("class", "my-css-class")); More methods can be seen here: https://cwiki.apache.org/WICKET/how-to-modify-an-attribute-on-a-html-tag.html Matthew -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/correct-way-to-get-css-classes-of-component-tp3248490p3249278.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org