Hi,

Is it possible to modify tag attribute (eg. add a CSS class) of
component which has set renderBodyOnly flag to true?
When using component.add(new AttributeModifier(...)) it has no effect,
because a tag in which this class attribute is appended is not
rendered in HTML (because of setRenderBodyOnly(true)).

Here is an example:
LinkContainer is a component (extends Panel) which has setRenderBodyOnly(true).

<wicket:panel>
        <a wicket:id="link"><wicket:container wicket:id="linkContent">[link
content]</wicket:container></a>
</wicket:panel>

Somewhere inside a page or panel:
add(new LinkContainer("link", ...).add(new AttributeModifier("class",
Model.of("my-link-style"))));
But of course this " class='my-link-style' " will not be rendered anywhere.

I want to add a class attribute to contained <a> tag but using a
behavior which can be added to the whole LinkContainer. Is it any
simple solution to achieve this?

--
DS

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to