Or use a WebMarkupContainer and an AttributeModifier.  Wrap this in your own
class so you're not writing HTML in your Java code.  Then your links are
actually in your HTML (except the SRC which gets generated in code) and your
designers can stylize the links etc.  Much better IMHO.

Something like:
 public class MyLink extends WebMarkupContainer {
    private static final long serialVersionUID = 1L;
    public MyLink(String id, IModel<String> model) {
        super(id);
        add(new AttributeModifier("src", true, model));
    }
}
In your HTML:
<a href="#" class="yourClass" wicket:id="yourID">your text</a>

It doesn't abuse Label this way, and is much more in line with the standard
Wicket way.

-- 
Jeremy Thomerson
http://www.wickettraining.com




On Sun, Dec 28, 2008 at 12:07 AM, Jan Kriesten
<kries...@mail.footprint.de>wrote:

>
> Hi Cristina,
>
> > Java:
> >
> >             // prefix and sufix hold the start and end of the img tag
> >             String imgTag = prefix + getImgURL() + sufix;
> >             add(new Label("imgDisplay", imgTag));
>
> try:
>
> add(new Label("imgDisplay", imgTag).setEscapeModelStrings(false));
>
> Best regards, --- Jan.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to