-
27 Nov 2008 11:31 PM #1
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
-
27 Nov 2008 11:34 PM #2
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.
-
27 Nov 2008 11:53 PM #3
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.
-
28 Nov 2008 12:10 AM #4
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

-
28 Nov 2008 12:36 AM #5
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.
-
28 Nov 2008 12:48 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
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;
-
28 Nov 2008 1:37 AM #7
I can not get your meaning.if the input is valid, the window will not close,so I should enable the button before return?


Reply With Quote