Captcha cookbook example - image not refreshing on wicket 1.5.7
Dear forum, Reading the Protecting against spam with a CAPTCHA section on chapter 2, Apache Wicket cookbook, I noticed that the captcha picture gets refreshed every time one clicks on the submit button and that no AJAX is involved. the example, uses wicket 1.4.9 but when I test the very same code on wicket 1.5 the Captcha image is not refreshed when one enters the wrong number or when one simply clicks submit button. Is there a way for the captcha image to be refreshed/re-rendered as it does on the original example without using AJAX? I haven't changed anything from the example other than having created a wicket 1.5.7 project on Eclipse and copied over the code. I tried using NonCachingImage instead of Image but it made no difference. Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Captcha-cookbook-example-image-not-refreshing-on-wicket-1-5-7-tp4649875.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: Captcha cookbook example - image not refreshing on wicket 1.5.7
Hi, Do you see ?pageId in the url ? If yes, then remove the pageId and load again See http://www.wicket-library.com/wicket-examples/captcha and org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource#invalidate() On Tue, Jun 12, 2012 at 3:49 PM, lucast lucastol...@hotmail.com wrote: Dear forum, Reading the Protecting against spam with a CAPTCHA section on chapter 2, Apache Wicket cookbook, I noticed that the captcha picture gets refreshed every time one clicks on the submit button and that no AJAX is involved. the example, uses wicket 1.4.9 but when I test the very same code on wicket 1.5 the Captcha image is not refreshed when one enters the wrong number or when one simply clicks submit button. Is there a way for the captcha image to be refreshed/re-rendered as it does on the original example without using AJAX? I haven't changed anything from the example other than having created a wicket 1.5.7 project on Eclipse and copied over the code. I tried using NonCachingImage instead of Image but it made no difference. Thanks in advance, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Captcha-cookbook-example-image-not-refreshing-on-wicket-1-5-7-tp4649875.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 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Captcha cookbook example - image not refreshing on wicket 1.5.7
Thanks for the answer Martin. But the example from wicket-library is not quite the same. Your answer, however, has help me find the solution that works on wicket 1.5. I wanted to keep the captcha functionality independent of the form, much as it is on the book. So I only changed three lines: First, instead of using an anonymous CaptchaImageResource object, i declared it private and part of the Captcha class. second, instead of using Image, I used NonCachingImage finally on the book, it resets the captcha value on the onBeforeRender() function of the panel. In there, I called captchaImageResource.invalidate() before the call to super.onBeforeRender(); That solved the problem. Thanks for your help, Lucas -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Captcha-cookbook-example-image-not-refreshing-on-wicket-1-5-7-tp4649875p4649880.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