Modify element attribute, preserve content

2011-01-26 Thread Alexandros Karypidis
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

Re: Modify element attribute, preserve content

2011-01-26 Thread Bas Gooren
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

Re: Modify element attribute, preserve content

2011-01-26 Thread Bas Gooren
Or, come to think of it, since you want to generate a href yourself on a link tag, use ExternalLink http://wicket.apache.org/apidocs/1.4/org/apache/wicket/markup/html/link/ExternalLink.html. Since it's a WebMarkupContainer underneath it will leave whatever is inside your a-tag intact. Bas