cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

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