on 01-20-2017 8:33 AM
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));
}
},
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.