You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smallufo <sm...@gmail.com> on 2009/12/09 18:42:41 UTC
Re: How to tackle Ajax "Flooding"
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 <ig...@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<to...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>