s/image/noncachingimage/
On 3/26/08, Matthew Young <[EMAIL PROTECTED]> wrote:
> I want to be able to show a new captcha image via an AjaxFallbackLink. But
> I don't know what to do in onClick to make the captcha img tag reload.
>
> public MyPage extends WebPage {
>
> private CaptchaImageResouce captchaImageResource;
>
> public MyPage() {
>
> add(new Image("captchaImg", new PropertyModel(this,
> "captchaImageResource")) {
> private static final long serialVersionUID = 1L;
> @Override protected void onBeforeRender() {
> regenerateCaptcha(); // make a new image
> super.onBeforeRender();
> }
> }.setOutputMarkupId(true));
>
> add(new AjaxFallbackLink("link") {
> @Override public void onClick(AjaxRequestTarget target) {
>
> // WHAT DO I DO HERE? Is there some javascript to make the
> img tag reload?
> if (target != null) {
> target.addComonent(MyPage.this.get("captchaImg")); //
> This is not enough to make it show
> }
> }
>
> }
> }
>
>
> public void regenerateCaptcha() {
> captchaResource = new CaptchaImageResource(randomString(3, 5));
> }
> }
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.2 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.2
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]