cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 - Link input field -> pass to oData key tab

Former Member
0 Kudos

Hi,

I would need help with getting a value from an input field to the oData query in the key tab to select data from the backend based on the input field. What I have now is this scenario: I have an input field on master1 view and and a button. When pressing the button, I navigate to master2 and on master2 I should display the list of orders selected from the backend. Currently it works so that the query method is called but the key value from the input field is not transferred, so I am missing the part in between. Where can I pass the input value?

I get the value from my input field controller for master1,js and navigate to master2:

 onSearchOrders : function(oEvent) {
 var SoldTo = this.getView().byId("SoldToInput");
   this.getRouter().navTo("master2", {
   from: "main",
   entity:"1" })
 },

In master2.js I have defined the path to get the sales orders from backend:

var sEntityPath = "/SalesOrderHdrSet";
this.bindView(sEntityPath);
var oEventBus = this.getEventBus();
var that = this;
this.byId("master2List").attachUpdateFinished(function() {
  that.selectFirstItem();
  oEventBus.publish("Master2", "LoadFinished", {
  oListItem: that.getView().byId("master2List").getItems()[0]
});
});
},

bindView: function(sEntityPath) {
		var oView = this.getView();
		oView.bindElement(sEntityPath);
	//Check if the data is already on the client
		if (!oView.getModel().getData(sEntityPath)) {
	// Check that the entity specified was found
	oView.getElementBinding().attachEventOnce("dataReceived", jQuery.proxy(function() {
	var oData = oView.getModel().getData(sEntityPath);
			}, this));
		}
	},

Accepted Solutions (0)

Answers (0)