That worked. Thank you Vineet! On Tue, Jul 19, 2011 at 2:17 AM, vineet semwal <[email protected]> wrote: > use ajaxlink instead of ajaxsubmitlink .. > > On Tue, Jul 19, 2011 at 8:37 AM, Alec Swan <[email protected]> wrote: >> Hello, >> >> We have a form with some required fields and a captcha image with >> CaptchaImageResource. Everything works great, but the default Wicket >> captcha component displays text which is hard to read for end-users. I >> added an AjaxSubmitLink("reCaptcha") button which should allow the >> user to re-generate the captcha image. >> >> However, the image does not get refreshed. The code is shown below. Is >> there a problem with the code or some recommended way to allow the >> end-user to regenerate captcha text? >> >> @Override >> protected void onSubmit(AjaxRequestTarget target, >> Form<?> form) { >> password = "blah1";//newPassword(); >> CaptchaImageResource captchaImageResource = new >> CaptchaImageResource(password); >> NonCachingImage imgCaptcha = new >> NonCachingImage("captchaImage", captchaImageResource); >> imgCaptcha.setOutputMarkupId(true); // required for >> AjaxFallbackLink >> addOrReplace(imgCaptcha); >> if (target != null) { >> target.addComponent(imgCaptcha); >> } >> } >> >> Thanks >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > > > > -- > thank you, > > regards, > Vineet Semwal > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
