I used NonCachingImage instead and it worked.

On Wed, Jun 9, 2010 at 12:15 PM, Josh Kamau <joshnet2...@gmail.com> wrote:

> I think the old image is being cached by the browser. any idea how to stop
> this?
>
> regards.
>
>
> On Wed, Jun 9, 2010 at 11:45 AM, Robert Kimotho <kimot...@gmail.com>wrote:
>
>> Here is some code that I think will help
>>
>>                        remove(image);
>>                        imagePass = randomString(6, 8);
>>                        captchaImageResource = new
>> CaptchaImageResource(imagePass);
>>                        image = new Image("captchaImage",
>> captchaImageResource);
>>                        add(image);
>>
>> you can have it inside your onClick(AjaxRequestTarget target) {}
>>
>> the key point to note is that you have to remove it first from the
>> component.
>>
>> Regards
>> Kimotho.
>>
>>
>> On Wed, Jun 9, 2010 at 11:14 AM, Josh Kamau <joshnet2...@gmail.com>
>> wrote:
>>
>> > Hi team;
>> >
>> > I am trying to regenerate a captcha to help users incase the previous
>> one
>> > was not very clear. I have tried several things including the code below
>> >
>> >                captchaImg = new CaptchaImageResource();
>> > captcha = new Image("captchaImg", captchaImg);
>> > captcha.setOutputMarkupId(true);
>> > frmRegistration.add(captcha);
>> > frmRegistration.setOutputMarkupId(true);
>> >  IndicatingAjaxFallbackLink<String> lnkTryNewCapcha = new
>> > IndicatingAjaxFallbackLink<String>("lnkTryNewCapcha") {
>> >
>> > @Override
>> > public void onClick(AjaxRequestTarget target) {
>> > captchaImg = new CaptchaImageResource();
>> > captcha.setOutputMarkupId(true);
>> > captcha.render();
>> > }
>> > };
>> >  frmRegistration.add(lnkTryNewCapcha);
>> >
>> > However i am not successful. Which is the best way to do this.
>> >
>> > Regards.
>> > Josh.
>> >
>>
>
>

Reply via email to