3.2.0

Response Being Triggered Multiple times

I have the following code that overrides the default ActiveXML.Table.response function. It seems to work fine when the page first loads.

obj.load() is executed on page load and also from a button click event

The button click causes the debug call (which just pops up an alert dialog) to happen four times indicating that the response was triggered four times. (Maybe once for each readystate?) But this doesn't seem to corresponde with what I see in the code.

Does anywone know what's going on?

obj.load = function() {
        var model = this.getActiveModel();
        var model_response = model.response;
        var myself = this;
        model.response = function( xml ) {
          try{
            myself.debug("Response triggered: ");
            myself.beforeResponse( xml );
            model_response.call( model, xml );
            myself.afterResponse( xml );
          }catch(exception) {
            alert( "response error: \n"+exception.message+"\n"+xml );
          }
        }
        model.request(  );
    }


Thanks
gbegley
May 24,
If you reuse the same model
var model = this.getActiveModel();

then you are adding one more debug call each time you press a button. Your new response method calls previous response method.

Alex (ActiveWidgets)
May 24,
Alex.

Your talent is exceeded only by your amity. I was stumped.

Thanks.
gbegley
May 24,

This topic is archived.

See also:


Back to support forum