Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)

Using Button in Table / sap.m


Here's another head cracker !

I have Table / sap.m component with 3 columns

A(Text / sap.mt)     B(Text / sap.m)      C(Button / sap.m

Tekst R1C1            Tekst R1C2           Button 1
Tekst R2C1            Tekst R2C2           Button 2

If I press f.ex "Button 2" it opens up a "SelectDialog / sap.m" 
In the "CONFIRM" event of dialog I would like to read content of R2C1 & R2C2.

I tried out the useual javascrip for reading select row in other compent, but I cant get to work properly. I'm not sure if it sees the row as selected when "Button 2" are pressed.

You have a workaround for this ?


Hi Henrik

First of all, create a global variable like this in a script block:


var currentRow; 


When you press Button 2, use this script on the press event:


var context = oEvent.oSource.getBindingContext();

// Global Variable
currentRow  = context.getObject();

// Open SelectDialog


When you now press the CONFIRM button, the row data is now in the variable currentRow.


Ole Andre 

Hi Ole-André,

You are a true life saver :D thanks a bunch, now It works as I wanted to.



Login or Signup to post a comment