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 '&lt;a wicket:id="bankURL" href="#"
>> target="_new"&gt;' Possible attempt to embed component(s) '&lt;img
>> wicket:id="bank" alt="" class="pic"/&gt;' 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:
>> &lt;a wicket:id="bankURL" href="#" target="_new"&gt;somewhere&lt;img
>> wicket:id="bank" alt="" class="pic"/&gt;&lt;/a&gt;
>>
>> 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:
>> >>
>> >> &lt;a href="http://www.gohere.com"&gt;&lt;img
>> >> src="images/logo.gif"&gt;&lt;/a&gt;
>> >>
>> >> I tried to do something like ExternalLink("link",
>> >> "http://www.gohere.com";,
>> >> "&lt;img src=\"images/logos/" + lender.getImageSrc() + "\"/&gt;"); 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

Reply via email to