on 10-29-2015 9:59 AM
Hi Saurabh,
Will this help?
http://jsbin.com/winepe/edit?html,js,output
Use this in dialog:
afterOpen : function(){
$(document).bind('keypress', function(e) {
if(e.keyCode==13){
e.preventDefault();
alert('Enter key Pressed');
sap.ui.getCore().byId("idClose").firePress();
}
});
}
Thanks,
KA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All
I have modified Karthik's JSBin to
http://jsbin.com/fefovu/edit?html,js,output
He is very close but we do not want to bind key event to document because when the dialog closes,
we want to binding to get away.
With Karthik's JSBin, close the dialog and then hit enter key again, you will get the alert. we do not want this.
Thanks
-D
Thanks KA and Dennis for your inputs. Now its working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this
$(document).bind('keypress', function(e) {
if(e.keyCode==13){
$('#submit').trigger('click');
}
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I placed the above code with alert() to check.
$(document).bind('keypress', function(e) {
if(e.keyCode==13){
e.preventDefault();
alert('Enter key Pressed');
$('#submit').trigger('click');
}
});
I placed it after opening fragment, and on pressing enter key it shows enter key pressed message, but it is still not triggering the submit button.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.