Re: Static image
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. I think this is the most helpful reply. A static image will be linked successfully this way. Thanks for the nice sharing. It helps a lot. - Best Regards, Arron | Image Processing SDK | Next Tomorrow is Another Day. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Static-image-tp4655192p4659931.html Sent from the Users forum 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
Re: Static image
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.comwrote: 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/
Re: Static image
Have you tried with ContextImage? 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é -- Andrea Del Bene Abaco Informatica S.r.l. Via Montegrappa, 3 61121 Pesaro (IT) Tel. +39 0721 35425 Fax. +39 0721 32967 P.IVA 00933130411 Associato AssoProvider CISCO Systems Partner PREMIER Certified ABANET is associated to RIPE (AS 12468) Http://www.abanet.it Questa é una email privata ad uso confidenziale; é proibito ogni uso non autorizzato. This message is confidential; any unauthorised use is forbidden. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Static image
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.comwrote: 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/