Skip to Content
avatar image
Former Member

Open Fragment from Table row on success callback of Odata Service call

Hello,

I have a sap.m.table with a Button binded to a fragment in all its rows. The button is the PR button as shown in the image below:

whenever we are changing the materialId in any item, there is an Odata Service call which populates the row data.
My requirement is that the PR fragment should open automatically during the success callback of the service call.

code for normally opening the PR fragment on click

if (!this.pr) {
				this.pr = sap.ui.xmlfragment("purchaseReq", "com.view.fragment.PurchaseRequisitions", this);
				this.getView().addDependent(this.pr);
			}
var oButton = oEvent.getSource();
this.pr.openBy(oButton);


This code works when you click on the fragment,
However, I am not able to get the button source for that specific table row item on success call back. So the fragment isnt opening.
Would appreciate if anyone can help me with this

Hope I was clear enough

table-image.png (16.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 10, 2017 at 12:44 PM

    in call back, "this" is not that "this",

    Add comment
    10|10000 characters needed characters exceeded