Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Johan Compagner
still the question remains how random is random ;)On 5/9/06, Igor Vaynberg [EMAIL PROTECTED] wrote: just checked it into corethe param looks like this wicket:antiCache=random -IgorOn 5/8/06, Bruno Borges [EMAIL PROTECTED] wrote:This could go to Wicket Core. But before this happens, one note: The

Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Matej Knopp
Johan Compagner wrote: still the question remains how random is random ;) right. maybe one shared atomically increased integer would do better job? On 5/9/06, *Igor Vaynberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: just checked it into core the param looks like this

Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Martijn Dashorst
On 5/9/06, Matej Knopp [EMAIL PROTECTED] wrote: Johan Compagner wrote: still the question remains how random is random ;)right. maybe one shared atomically increased integer would do better job?System.nanoTime() should do the trick :-) Martijn

Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Johan Compagner
i think millis will do. If you have a request in the same milli second for the same image.Then the image should really be the same, What can possible change in 1 milli! :)johan On 5/9/06, Martijn Dashorst [EMAIL PROTECTED] wrote: On 5/9/06, Matej Knopp [EMAIL PROTECTED] wrote: Johan Compagner

Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Matej Knopp
System.nanoTime() is @since 1.5, so I don't think it's usable anyway :) Johan Compagner wrote: i think millis will do. If you have a request in the same milli second for the same image. Then the image should really be the same, What can possible change in 1 milli! :) johan On 5/9/06,

Re: [Wicket-user] changing images with Ajax

2006-05-09 Thread Igor Vaynberg
heh, i think its random enough. how many decimal places does it show? but you guys can do whatever you want of course :)-IgorOn 5/9/06, Matej Knopp [EMAIL PROTECTED] wrote:System.nanoTime () is @since 1.5, so I don't think it's usable anyway :)Johan Compagner wrote: i think millis will do. If you

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Potje rode kool
How are you adding those parameters the the image URL?In html I have an image tag like this:img wicket:id=image/and in code:Resource resource = Image image = new Image(image, resource); I also tried:Image image = new Image(image, new Model(/images/sunshine.png));But than it tries to find the

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Igor Vaynberg
try this:Image image = new Image(image, resource) { protected void onComponentTag(final ComponentTag tag) { super.onComponentTag(tag); String src="" src=""> tag.set(src, src);}; if it works you can encapsulate it into a NonCachingImage or something-IgorOn 5/8/06, Potje rode kool [EMAIL

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Potje rode kool
Ok, thanks all for the help on this problem for me.My Image subclass that I created based on the code of Igor looks like this:class NonCachableImage extends Image{ public NonCachableImage(String id, IModel model) { super(id, model); } protected void onComponentTag(final ComponentTag tag) {

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Eelco Hillenius
Fine with me. If something thinks of a nice API. Eelco On 5/8/06, Martijn Dashorst [EMAIL PROTECTED] wrote: This seems common enough, shouldn't we add this to core (of course, only when it works :-))? Martijn On 5/8/06, Igor Vaynberg [EMAIL PROTECTED] wrote: try this: Image image =

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Bruno Borges
This could go to Wicket Core. But before this happens, one note:The 'rand' parameter should be renamed to something like .wicket_rand. 'rand' is too simple... :)Regardsm On 5/8/06, Eelco Hillenius [EMAIL PROTECTED] wrote: Fine with me. If something thinks of a nice API.EelcoOn 5/8/06, Martijn

Re: [Wicket-user] changing images with Ajax

2006-05-08 Thread Igor Vaynberg
just checked it into corethe param looks like this wicket:antiCache=random-IgorOn 5/8/06, Bruno Borges [EMAIL PROTECTED] wrote:This could go to Wicket Core. But before this happens, one note: The 'rand' parameter should be renamed to something like .wicket_rand. 'rand' is too simple... :)Regardsm

Re: [Wicket-user] changing images with Ajax

2006-05-07 Thread Igor Vaynberg
well, if the browser ignores that then you should change the url.-IgorOn 5/7/06, Potje rode kool [EMAIL PROTECTED] wrote:Yes, its a caching problem, when I disable caching in Firefox (doing this with the web developer toolbar) it works fine. How do I add those headers for the images I want to

Re: [Wicket-user] changing images with Ajax

2006-05-07 Thread Bruno Borges
Make random URLs for the image. You can do that simply adding dummy parameters, like /image.ext?foo=bar1, bar2, bar3... etc. The browser cache resources per URL. I think this will work.See ya On 5/7/06, Igor Vaynberg [EMAIL PROTECTED] wrote: well, if the browser ignores that then you should change

Re: [Wicket-user] changing images with Ajax

2006-05-07 Thread Anatol Pomozov
I usually do such thing/path_to_img.png?random_numberso example image path is /images/logo.png?32342342342 or /images/logo.png?rand=32342342342On 5/7/06, Bruno Borges [EMAIL PROTECTED] wrote: Make random URLs for the image. You can do that simply adding dummy parameters, like /image.ext?foo=bar1,

Re: [Wicket-user] changing images with Ajax

2006-05-07 Thread Potje rode kool
The only way I currently found and that worked was to create a subclass of ResourceReference with a random generated name.Not sure if that is the best solution.2006/5/7, Bruno Borges [EMAIL PROTECTED]: Make random URLs for the image. You can do that simply adding dummy parameters, like

[Wicket-user] changing images with Ajax

2006-05-06 Thread Potje rode kool
Hi,I am trying to change an image after an AjaxLink is clicked but I can't get it working.The images are on a Panel, when I click on the AjaxLink I create a new Panel and replace the old one (by calling getPage().replace(Component) ). I also have put an Label on the Panel and the Label gets

Re: [Wicket-user] changing images with Ajax

2006-05-06 Thread Igor Vaynberg
are you updating img's src attribute in the ajax call? or is the image streamed from somewhere and reflects a property you changed with ajax?the first should workthe lettter might not unless the url changes - because the browser would have the cached version and no reason to reload it. so you