Use a WebMarkupContainer and add a SimpleAttributeModifier behavior to it. It will not touch the contents of the tag it's attached to, leaving your own html as it is.

Bas

Op 26-1-2011 22:38, Alexandros Karypidis schreef:
Hello,

I have the following case which I do not know how to handle with Wicket:

I have an element (specifically it is an<a href="">...</a>  link) for which I
need to generate an attribute's value dynamically (specifically, I need to set
the "href" attribute at runtime), but I need to preserve the static content of
the page.

For example, my HTML file is:

<a wicket:id="myTarget"><span class="x"></span>some static text</a>

What do I have to do to produce:

<a href="dynamically generated target"><span class="x"></span>some static
text</a>

So far, I've always replaced the entire content of an element with that
generated by some wicket component, but this is the first time I've needed to
"filter" part of the DOM and target something very specific in the middle of the
tree, without affecting the rest of the tree...




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to