The context image looks nice, but I cannot use it in a ClientSideImageMap -
is that on purpose?

For now UrlResourceReference serves my purpose.

Thank you for helping


On 8 January 2013 09:09, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> Here is the source of
> org.apache.wicket.markup.html.image.Image#getStatelessHint()
> {
> return (getImageResource() == null || getImageResource() ==
> localizedImageResource.getResource()) &&
>  localizedImageResource.isStateless();
> }
>
> I.e. if the image uses a IResource then it is stateful because the url to
> the IResource is dependent on the component (e.g.
> ?2-IResourceListener-container~image).
> If you use ResourceReference then the url to reach it doesn't depend on the
> page/component (e.g. wicket/resource/....).
>
> As Andrea mentioned you can use ContextImage which also doesn't use
> IResource and the generated url doesn't depend on the page/component.
>
>
> On Tue, Jan 8, 2013 at 12:30 AM, René Vangsgaard
> <rene.vangsga...@gmail.com>wrote:
>
> > Hi - I would like to link to a static image, and the link should be
> > stateless.
> >
> > I have tried this (using Scala):
> >
> > val img = new Image("img", new ContextRelativeResource("images/img" +
> imgId
> > + ".png"))
> >
> > But the link becomes stateful.
> >
> > I just found
> >
> > val img = new Image("img", new UrlResourceReference(new
> Url(listOfStrings,
> > Charset.defaultCharset())))
> >
> > Is the last example the preferred way of achieving this?
> >
> > Thanks in advance,
> > René
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Reply via email to