Reputation: 47
I have some data input fields inside a sap.m.table
. Wanted to use Tab key to navigate to the input fields but it doesn't work.
It seems the SAP application interface hasn't implemented this feature.
I tried with some custom function and not working.
Any solution or alternative for this feature?
Upvotes: 1
Views: 3109
Reputation: 31
It's no longer necessary to use a custom solution for this. As of SAPUI5 version 1.38.0 sap.m.table has a property called 'keyboardMode' that can be set to 'Edit' which will change the tab behaviour to navigate focus through all editable fields in the table.
This mode is suitable if the number of items is limited and if there are editable fields within the item.
While the last/first interactive element within an item has the focus, pressing tab/shift+tab moves the focus to the next/previous element in the tab chain after/before the item .
https://sapui5.hana.ondemand.com/#/api/sap.m.ListKeyboardMode
Upvotes: 0
Reputation: 47
SAP itself now come up with the solution. Navigation with the TAB key is available form SAPUI5 version 1.44.
SAP NOTE 2387996 - SAPUI5 unable to use Tab to move to next field. We have to press F2 key to activate this.
Upvotes: 2
Reputation: 255
Attach browser event
new sap.m.Input({
value:"{first}"
}).attachBrowserEvent("keydown",function(oEvent){
if(oEvent.key == 'Tab'){
alert(this);//this reference to input control
//Your logic here
}
})
Upvotes: -1