The problem occers when it is rendering. 

The images / page render fine when the src is hardcoded in the html file.

It also works when I use the web markupcontainer and manipulate the src 
attribute as shown below.

ExternalLink link = new ExternalLink("partnerLink", partnerLink);
        final String imageUrl = partnerIconUrl;
        WebMarkupContainer srcTag = new WebMarkupContainer("partnerIcon");
        IModel mediaSrc = new AbstractReadOnlyModel(){
            @Override
            public String getObject(){
                return imageUrl;
            }
        };
        srcTag.add(new AttributeModifier("src", mediaSrc));
        
        link.add(srcTag);
        add(link);

> Date: Fri, 5 Dec 2008 16:59:17 -0600
> From: [EMAIL PROTECTED]
> To: users@wicket.apache.org
> Subject: Re: create clickable icons (serving as external links) - Sends 
> server into a endless loop
> 
> I don't see anything right away wrong with your code below.   So, maybe a
> couple questions will help:
> 
> Goes into an endless loop when?  When it's rendering?  When loading image?
> When clicking on link?
> Also - what HTML does your code below produce?
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> On Fri, Dec 5, 2008 at 4:49 PM, Ed _ <[EMAIL PROTECTED]> wrote:
> 
> >
> > I am trying to create clickable icons that would link to an external page.
> >
> > I came across -
> > http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html - But
> > the server just goes into an endless loop.
> >
> > pointers?
> >
> > Ed
> >
> >
> > ExternalLink link = new ExternalLink("partnerLink", partnerLink);
> >        StaticImage sImg = new StaticImage("partnerIcon", new
> > Model(partnerIconUrl));
> >        link.add(sImg);
> >        add(link);
> >
> >
> > html xmlns:wicket>
> > <wicket:panel>
> >    <div class="partner_panel">
> >        <a href="#" wicket:id="partnerLink">
> >             <img wicket:id="partnerIcon" width="50" height="35" src="#" />
> >        </a>
> >    </div>
> > </wicket:panel>
> > </html>
> >
> >
> > class StaticImage extends WebComponent {
> >
> >    public StaticImage(String id, IModel model) {
> >        super(id, model);
> >    }
> >
> >    protected void onComponentTag(ComponentTag tag) {
> >        super.onComponentTag(tag);
> >        checkComponentTag(tag, "img");
> >        tag.put("src", getModelObjectAsString());
> >    }
> >
> > }
> >
> >
> > _________________________________________________________________
> > Suspicious message? There's an alert for that.
> >
> > http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008
> >

_________________________________________________________________
You live life online. So we put Windows on the web. 
http://clk.atdmt.com/MRT/go/127032869/direct/01/

Reply via email to