on ‎2017 May 28 1:49 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
As you have assigned the model to the core and without any model name , so you can access bindingContext without model name. So just try the below code. Below code give you just the one selected row data not the whole table data
var sItem = oTable.getSelectedItem();
var sData = sItem.getBindingContext().getProperty();
Thanks
Viplove
Thanks Viplove, It worked 🙂
Thank you so much 🙂
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.