Skip to Content
0

get row Index of a Table in SAP UI5

Apr 24, 2017 at 03:54 PM

113

avatar image

Hi All,

I am new to SAP UI5. I have created a frontend table and displayed its data from ECC end using netweaver gateway connection.

Now this table has a toolbar with 'EXECUTE' button. When execute button is clicked, a dialog pop up will open with the row details.

If user clicks 'OK' , then the "rowIndex" of the particular row will be passed to ECC and further processing will be done at ECC level. But I am unable to get the rowIndex using RowSelectionChange event.

Please help me with what I am doing wrong.

Regards

Meenakshi

scn3.png (58.6 kB)
scn4.png (17.9 kB)
scn1.png (14.9 kB)
scn2.png (8.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Srikanth KV Apr 24, 2017 at 04:19 PM
0
Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Apr 24, 2017 at 04:51 PM
0

pass id to backend not the index.

Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Apr 24, 2017 at 06:37 PM
0

your code is correct and u should get index on row selection, but RowSelectionChange event will only be triggered on row selection not click on that execute button,

and to get selected row index on any other button press event write below:

oTable.getSelectedIndex();

And, yes you should pass objectID to backend that you can get using row index.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Akhilesh,

Thanks for your answer. My RowSelectionChange event is triggered. But there is no value passed in "rowIndex". I.e. i do not get any messages.

I am not sure what is wrong with my code. Have I declared the message incorrectly ?

Regards

Meenakshi

0

If you just want to test that rowIndex value why can't u just alert it , why are you using these messages control and also you just need to send the rowindex to ECC .. if you want to show it as message than show it using sap.m.messageBox as suggested by Akhilesh

thanks

Viplove

0

oh yeah, you wants to show message ? use sap.m.MessageBox or check below

https://openui5.hana.ondemand.com/test-resources/sap/ui/commons/demokit/MessageBox.html

0