use ajaxlink instead of ajaxsubmitlink ..

On Tue, Jul 19, 2011 at 8:37 AM, Alec Swan <alecs...@gmail.com> 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: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to