Wow , thanks for this great tip ...

But I have problem applying to Gmap2 :
I hope when user clicks the map , the map won't be able to receive any
requests until the onClick() finishes...
But it seems this doesn't work...
Is there anything I missed ?

gmap2.add(new ClickListener()
{
  @Override
  protected void onClick(AjaxRequestTarget target, GLatLng latLng, GOverlay
overlay)
  {
    // high computation ...
  }

  @Override
  protected IAjaxCallDecorator getAjaxCallDecorator()
  {
    return new IAjaxCallDecorator()
    {
      @Override
      public CharSequence decorateScript(CharSequence script)
      { return "this.enabled=false;"+script; }

      @Override
      public CharSequence decorateOnSuccessScript(CharSequence script)
      { return script+";this.enabled=true;"; }

      @Override
      public CharSequence decorateOnFailureScript(CharSequence script)
      { return script+";this.enabled=true;"; }
    };
  }
});



2009/8/31 Igor Vaynberg <igor.vaynb...@gmail.com>

> add(new ajaxbutton("button") {
>  getajaxcalldecorator() {
>     return new iajaxcalldecorator() {
>         decoratescript(script) { "return this.enabled=false;"+script; }
>         decorateonfailurescript(script) { return
> script+";this.enabled=true;";}
>         decorateonsuccessscript(script) { return
> script+";this.enabled=true;";}
>     }
>  }
> }
>
> doesnt look like a lot of javascript to me. further you can factor it
> out into a separate class and reuse it all over the place.
>
> -igor
>
>
> On Mon, Aug 31, 2009 at 5:40 AM, Tom Wollert<tom.woll...@googlemail.com>
> wrote:
> > The only idea I can come up with is to keep state of my model on client
> > side, but that would require alot of javascript :/
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to