So you mean i need to create a panel just for the purpose of changing the
body tag attribute? that sounds a little bit odd.
as for the other way of using the AttributeModifier, it works ok but then
now you have to expose the body component thru a getter method as other
components has to get access to it when they are added to the page, since
body contains all the other stuff. that seems even more hassle. or unless
i'm mistaking something here?
Andreas Petersson wrote:
>
> as i understand it from the javadoc you only need a
> BodyTagAttributeModifier if you create a PANEL that has the desire to
> add something to the parent <body> tag.
> since you do not have a panel, but rather an ordinary page, you can
> simply assign a wicket:id to your body and alter the attribute as you
> whish, either as described by you or by using the more common
> AttributeModifier
>
> in html: <body wicket:id="mybody">...
>
> in code: new WebMarkupContainer("mybody").add(new
> AttributeModifier("class", true, new Model<String>("myclass")));
> string could only be "automatically" cast to model because it does not
> implement the IModel interface.String is not aware that IModel even
> exists, like all other core java classes.
>
>> ok, so i did
>> i would appreciate if someone can explain to me why the above code
>> actually
>> works and the BodyTagAttributeModifier didn't. btw, i now knew that
>> String
>> is not automatically cast to Model. my bad.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/how-to-use-the-BodyTagAttributeModifier-class--tp24875297p24881924.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]