Skip to Content

get row Index of a Table in SAP UI5

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 24, 2017 at 04:19 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24, 2017 at 04:51 PM

    pass id to backend not the index.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 24, 2017 at 06:37 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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