views:

210

answers:

1

i'm trying to dynamically add the class attribute to the body tag, and i came across this class. but i can't seem to understand how to use this class. i have something like this in my page class (or panel class, as i tried with that too):

add(new BodyTagAttributeModifier("class", "homepage", this));

this doesn't even compile, saying there's something wrong with the 2nd parameter. but i think String is automatically considered a Model in wicket, like the Label class. am i missing something here?

A: 

What if you just add an wicket:id to the body attribute and use the AttributeAppender class? Or, if the body attribute already has an id, can't you just use this class?

http://wicket.sourceforge.net/apidocs/wicket/behavior/AttributeAppender.html

Ravi Wallau