ee3a84w
Thursday, January 8, 2009

Success Handler Scope on Form POST

  • I must be missing something here. I am trying to set the scope on the success handler of a form post. I have tried numerous ways, and I can get inline success/failure functions to work, but I can not get a reference the parent class and I can not seem to get the scope.

    I am trying:

    buttons: [{
    text: 'Login',

    handler: function() {
    if (loginForm.getForm().isValid()){
    loginForm.getForm().submit({
    url:'/extPublicAdapter/extAdapter.lf?request=login',
    success: this.loginResult,
    failure: this.loginFailure,
    scope: this,
    });
    }
    }
    }]

    I don't get any error, but also my log() in loginResult() and/or loginFailure() never gets run. I am using firebug and see the response from the server but nothing happens. What am I missing?


  • Perfect, thank you!


  • The default scope for a button handler is the button. You can specifiy an alternate scope:

    buttons: [{
    text: 'Login',
    scope:this, //or explicitly: MyApp
    handler: function() {
    if (loginForm.getForm().isValid()){
    loginForm.getForm().submit({
    url:'/extPublicAdapter/extAdapter.lf?request=login',
    success: this.loginResult,
    failure: this.loginFailure,
    scope: this,
    });
    }
    }
    }]







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Success Handler Scope on Form POST , Please add it free.