on 04-04-2017 9:09 AM
Hello,
I am trying to get the index of a row in sap.m.table when user clicks on the value help request icon in a multinput control as highlighted below.
I have used sap.ui.comp.valuehelpdialog.ValueHelpDialog inside the sap.m.table in a multiinput.
Tried a few links and suggestions mentioned on SCN, but couldnt achieve the functionality.
My aim is to set the the value selected from value help in the multiinput, for which I need to bind it with the model of the table and hence I need the index of the table.
Below is the link which I tried :
https://blogs.sap.com/2016/09/05/suggestionsearchvalue-help-in-table-for-multiple-input-fields-in-sa...
In this example, the index is retrieved using the e.getsource().getId() and truncating the index from it, but in my case I am getting dynmic SId and so cannot use the same.
Please suggest.
you can try using binding context as below,
var sBindingContext = oEvent.getSource().getBindingContext();
var sPath = sBindingContext.sPath; //this will return the row binding path for example "/results/1" 1 is row index
// even you can get row data using below code if you need
var rowData = sBindingContext.getObject();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
don't use index, you will get bite.
you can use this to update the value.
setProperty(sPath, oValue, oContext?, bAsyncUpdate?)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I am not sure, what issue you are facing exactly. but you can get row index even if controls are having dynamic id also, check below link if it is help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.