Skip to Content

sap.m.table and sap.ui.commons syntax difference

Hi All,

Sometime back, I was working on Tables and I used sap.ui.commons library. In the table, I have created a toolbar. When a row is selected and "display button" from the toolbar is clicked, a dialog box opens up , and details of that item are shown in that dialog box.

Screenshot of the code -

Now I am using SAP.M. library. But I am facing an issue while getting the "rowcontext". I tried various options, but I am not able to get the rowContext. Can anyone please help me with the syntax.

In debug mode, I can see that my oContext is undefined.

I want to access the values that are marked in RED in the screenshot -

example - AProject, ATitle, AUnid....... Please help me in this

Regards

Meenakshi

capture.png (23.6 kB)
capture1.png (25.9 kB)
code.png (73.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 29, 2017 at 07:14 AM

    Hi Meenakshi ,

    If you want to get the attached data to the selected item than you can just simply get the bindingContext of the selected Item..

    var sItem = oTable.getSelectedItem();

    var sData = sItem.getBindingContext("this is your model name attach to the table").getProperty();

    sData will have the data attach to the row you have selected

    thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 29, 2017 at 04:55 AM

    Hi,

    You can get the binding context on click on table line Items:

    var object=oEvent.getSource().getParent().getModel().getProperty(oEvent.getSource().getBindingContext().sPath);

    Thanks,

    Rohit.

    Add comment
    10|10000 characters needed characters exceeded