on 2019 May 08 2:29 PM
Hi All,
I am using the concept of Event bus to make communication between two controllers :
I have publish in one controller :
goToInbox: function() { // to handle the page refresh. changes done by rakshit_x
var oEventBus = sap.ui.getCore().getEventBus();
oEventBus.publish("master", "onNavBackLoad");
// Route back to First screen
var oRouter = sap.ui.core.UIComponent.getRouterFor(this); oRouter.navTo("ClaimInboxMaster"); }
The Subscribe in another controller :
sap.ui.getCore().getEventBus().subscribe("master", "onNavBackLoad", this.onNavBackLoad, this);
which calls the function :
onNavBackLoad: function() {
var _self = this; showBusy();
sap.ui.core.BusyIndicator.show(0); //$.when(_self.status(_self)).done(function() { $.when(_self.getMasterData()).done(function() {
var list = _self.getView().byId("claimHeader");
list.getBinding("items").filter([]);
_self.byId("statusSelect").setSelectedKey("All");
if (list.getItems().length > 0) { list.setSelectedItem(list.getItems()[0], true, true); } }); // }); },
Inside the above function i am calling getmasterdata function where it has to to a call to the backend. The issue i am facing is sometimes its works fine. but sometimes odata is not getting initialized and giving an error of undefined.
var oDataModelRead = this.getOwnerComponent().getModel("oDataModelSRV"); sometimes works where as sometimes don't work. Please help me on this to resolve the issue.
Thanks
Request clarification before answering.
User | Count |
---|---|
79 | |
29 | |
9 | |
9 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.