Thanks, however I still get the same error: WicketMessage: Expected close tag for '<a wicket:id="bankURL" href="#" target="_new">' Possible attempt to embed component(s) '<img wicket:id="bank" alt="" class="pic"/>' in the body of this component which discards its body
and my code looks like: ExternalLink link = new ExternalLink("bankURL", lender.getLenderWebsite(), lender.getLender()); StaticImage image = new StaticImage("bank", "images/logos/" + lender.getImageSrc(), lender.getLender()); link.add(image); add(link); Thanks, Jason Jeremy Thomerson-5 wrote: > > I think your problem is that in your long add() call, you are actually > adding the image to your outer container rather than the link. The code > is > formatted poorly in the email. Try this: > > ExternalLink link = new ExternalLink(......) > link.add(new StaticImage(......)) > add(link); > > On Tue, Feb 24, 2009 at 6:03 PM, novotny <novo...@gridsphere.org> wrote: > >> >> >> That's exactly what I tried and I get >> >> WicketMessage: Expected close tag for '<a wicket:id="bankURL" href="#" >> target="_new">' Possible attempt to embed component(s) '<img >> wicket:id="bank" alt="" class="pic"/>' in the body of this component >> which discards its body >> >> here's my java >> add(new ExternalLink("bankURL", lender.getLenderWebsite(), >> lender.getLender()).add(new StaticImage("bank", "images/logos/" + >> lender.getImageSrc(), lender.getLender()))); >> >> >> and my html: >> <a wicket:id="bankURL" href="#" target="_new">somewhere<img >> wicket:id="bank" alt="" class="pic"/></a> >> >> Thanks, Jason >> >> >> igor.vaynberg wrote: >> > >> > the bottom of that page shows you how to embed an external image into >> > an external link. >> > >> > -igor >> > >> > On Tue, Feb 24, 2009 at 3:24 PM, novotny <novo...@gridsphere.org> >> wrote: >> >> >> >> Hi all, >> >> >> >> Apologies for such a simple question but I couldn't find anything-- >> the >> >> closet was >> >> http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html >> >> but it just didn't work for me. >> >> >> >> Here's the html I want: >> >> >> >> <a href="http://www.gohere.com"><img >> >> src="images/logo.gif"></a> >> >> >> >> I tried to do something like ExternalLink("link", >> >> "http://www.gohere.com", >> >> "<img src=\"images/logos/" + lender.getImageSrc() + "\"/>"); but >> it >> >> escaped the img I tried to pass in as a label. >> >> >> >> Thanks a bunch! >> >> >> >> Jason >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/external-image-inside-link-tp22193027p22193027.html >> >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> > For additional commands, e-mail: users-h...@wicket.apache.org >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/external-image-inside-link-tp22193027p22193550.html >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > -- > Jeremy Thomerson > http://www.wickettraining.com > > -- View this message in context: http://www.nabble.com/external-image-inside-link-tp22193027p22193714.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org