Hybrid View

  1. #1
    Ext User
    Join Date
    Nov 2008
    Posts
    5
    Vote Rating
    0
    yuncong8 is on a distinguished road

      0  

    Exclamation Ext.Button fire more than once when continually click

    Ext.Button fire more than once when continually click


    I create a window with two buttons "ok" and "cancle",when the "ok" button is click,it make panel submit user information and the window will close.
    when you operate by mouse,everything is ok,but if the "ok" button is focused,then continually click "space" or "Enter",it send user information more than once.

    the button should be disable for 20 millisecond, i think.
    Last edited by mystix; 28 Nov 2008 at 12:43 AM. Reason: merged duplicate thread. moved to 2.x Help from 2.x Bugs

  2. #2
    Ext User
    Join Date
    Nov 2008
    Posts
    5
    Vote Rating
    0
    yuncong8 is on a distinguished road

      0  

    Red face Ext.Button is fired more than once when click continually

    Ext.Button is fired more than once when click continually


    I create a window with two buttons "ok" and "cancle",when the "ok" button is click,it make panel submit user information and the window will close.
    when you operate by mouse,everything is ok,but if the "ok" button is focused,then continually click "space" or "Enter",it send user information more than once.

    the button should be disable for 20 millisecond, i think.

  3. #3
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    When adding the listener you can add a delay option to delay invocation of the handler or a single option to ensure the handler is only invoked once.

    You may want to check if the window is open in the hanlder too before executing.

  4. #4
    Ext User
    Join Date
    Nov 2008
    Posts
    5
    Vote Rating
    0
    yuncong8 is on a distinguished road

      0  

    Default


    it's not effective,because I should validate the input,if it's not valid,the window will not close.

    var hidebutton = new Ext.Button({text: 'hide',hidden: true,handler:function(){}});
    var finishButton = new Ext.Button({
    text:'Finish',
    minWidth:70,
    handler: function(){
    hidebutton.focus();
    inputValid();
    panel.getForm.submit();
    win.close();
    }
    });

    when click the button,I move the focus to a hidden button,but it works in firefox but not is IE.
    in Internet Explore the panel will submit more than once when the button is on focus and click "space" continually.

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    The problem is that the button el is the outer table and not the inner button element.

    You could really disable the button with:
    Code:
    submitButton.getEl().child(submitButton.buttonSelector, true).disabled = true;

  6. #6
    Ext User
    Join Date
    Nov 2008
    Posts
    5
    Vote Rating
    0
    yuncong8 is on a distinguished road

      0  

    Default


    I can not get your meaning.if the input is valid, the window will not close,so I should enable the button before return?

  7. #7
    Ext JS Premium Member
    Join Date
    May 2007
    Posts
    698
    Vote Rating
    3
    danh2000 is on a distinguished road

      0  

    Default


    You have posted this in mutiple forums - this is NOT a bug.

    Please familiarise yourself with this thread:

    http://extjs.com/forum/showthread.php?t=13985

    And please wait for a response before posting the same details in multiple places


Thread Participants: 2