Re: [Wicket-user] IMG reload via AJAX
Yes, but what if the clock fails? :) Johan Compagner schrieb: my god! how brilliant! Igor++! On 4/12/06, Timo Stamm [EMAIL PROTECTED] wrote: Igor Vaynberg schrieb: you are absolutely right, how foolish of me. a better way of course would be url=url+rand=+UUID.random().toString() but wait...even with that there is a chance of collission...hmmm how about you have a static BigInteger in your resource, and use that as a sequence to generate unique ids to append to the url! System.currentTimeMillis() --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] IMG reload via AJAX
there are a couple of ways:one) add anti caching headers to your resourcetwo) append a random number to the resource url-IgorOn 4/7/06, Jerry Smith [EMAIL PROTECTED] wrote: Hi all, I'm trying to get an Image to reload via AJAX. Basically I've got some thumbnails when the user clicks on them I want to display the full version. The model is changing, but the screen isn't refreshing quite right. The AJAX response comes back but the graphic doesn't update unless I force the browser to refresh. The url for the img src attribute is the same everytime, I'm using a subclass of WebResource to feed the Image. Any ideas on how to get this working would be awesome! Thanks!
RE: [Wicket-user] IMG reload via AJAX
Ive already got res.setHeader(Cache-Control, no-cache); res.setHeader(Cache-Control, no-store); in the resource, how do I go about changing the src url? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Vaynberg Sent: Friday, April 07, 2006 3:29 PM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] IMG reload via AJAX there are a couple of ways: one) add anti caching headers to your resource two) append a random number to the resource url -Igor On 4/7/06, Jerry Smith [EMAIL PROTECTED] wrote: Hi all, I'm trying to get an Image to reload via AJAX. Basically I've got some thumbnails when the user clicks on them I want to display the full version. The model is changing, but the screen isn't refreshing quite right. The AJAX response comes back but the graphic doesn't update unless I force the browser to refresh. The url for the img src attribute is the same everytime, I'm using a subclass of WebResource to feed the Image. Any ideas on how to get this working would be awesome! Thanks!
Re: [Wicket-user] IMG reload via AJAX
what are you using right now to display images?usually i call urlfor(resourcereference), get the url, append rand=+Math.random() and use an attributemodifier or oncomponenttag() to set the src attr of an img tag. -IgorOn 4/7/06, Jerry Smith [EMAIL PROTECTED] wrote: I've already got res.setHeader(Cache-Control, no-cache); res.setHeader(Cache-Control, no-store); in the resource, how do I go about changing the src url? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Igor Vaynberg Sent: Friday, April 07, 2006 3:29 PM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] IMG reload via AJAX there are a couple of ways: one) add anti caching headers to your resource two) append a random number to the resource url -Igor On 4/7/06, Jerry Smith [EMAIL PROTECTED] wrote: Hi all, I'm trying to get an Image to reload via AJAX. Basically I've got some thumbnails when the user clicks on them I want to display the full version. The model is changing, but the screen isn't refreshing quite right. The AJAX response comes back but the graphic doesn't update unless I force the browser to refresh. The url for the img src attribute is the same everytime, I'm using a subclass of WebResource to feed the Image. Any ideas on how to get this working would be awesome! Thanks!
Re: [Wicket-user] IMG reload via AJAX
On 4/7/06, Igor Vaynberg [EMAIL PROTECTED] wrote: usually i call urlfor(resourcereference), get the url, append rand=+Math.random() and use an attributemodifier or oncomponenttag() to set the src attr of an img tag. Did you calculate the chance you have with Math.random() how many times it could generate the same url after X number of calls?:)johan
Re: [Wicket-user] IMG reload via AJAX
you are absolutely right, how foolish of me.a better way of course would be url="">but wait...even with that there is a chance of collission...hmmm how about you have a static BigInteger in your resource, and use that as a sequence to generate unique ids to append to the url!-IgorOn 4/7/06, Johan Compagner [EMAIL PROTECTED] wrote: On 4/7/06, Igor Vaynberg [EMAIL PROTECTED] wrote: usually i call urlfor(resourcereference), get the url, append rand=+Math.random() and use an attributemodifier or oncomponenttag() to set the src attr of an img tag. Did you calculate the chance you have with Math.random() how many times it could generate the same url after X number of calls?:)johan
Re: [Wicket-user] IMG reload via AJAX
url=url+rand=+UUID.random().toString() but wait...even with that there is a chance of collission...hmmm Is there? Isn't UUID supposed to be unique in space and time? Eelco --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid0944bid$1720dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] IMG reload via AJAX
no, not unique, but pretty darn close.-IgorOn 4/7/06, Eelco Hillenius [EMAIL PROTECTED] wrote: url=""> but wait...even with that there is a chance of collission...hmmmIs there? Isn't UUID supposed to be unique in space and time?Eelco--- This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcastand join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642___ Wicket-user mailing listWicket-user@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] IMG reload via AJAX
and in case someone takes this suggestion seriously - dont. johan is just being sarcastic...or at least i really really hope he is :)-IgorOn 4/7/06, Eelco Hillenius [EMAIL PROTECTED] wrote: url=""> but wait...even with that there is a chance of collission...hmmmIs there? Isn't UUID supposed to be unique in space and time? Eelco---This SF.Net email is sponsored by xPML, a groundbreaking scripting languagethat extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 ___Wicket-user mailing listWicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user
Re: [Wicket-user] IMG reload via AJAX
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 so... NSUUID? Igor Vaynberg wrote: no, not unique, but pretty darn close. -Igor On 4/7/06, *Eelco Hillenius* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: url=url+rand=+UUID.random().toString() but wait...even with that there is a chance of collission...hmmm Is there? Isn't UUID supposed to be unique in space and time? Eelco --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 http://sel.as-us.falkag.net/sel?cmdlnkkid0944bid$1720dat1642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net mailto:Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user https://lists.sourceforge.net/lists/listinfo/wicket-user - -- Justin Lee http://www.antwerkz.com AIM : evan chooly Skype : evanchooly -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.1 (Cygwin) iD8DBQFENufXJnQfEGuJ90MRAylKAKDMxUc2w9e67eVb/aKkLBWRTanZXACgr+MZ KrXfZn2yD7unXd+cnSTpfgg= =1zfd -END PGP SIGNATURE- --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user