Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Binding problem between Master and Detail view in SAPUI5 using OData Model

$
0
0

Hi Experts,

 

Requirement is when user clicks on master view data then details data should be appear in detail view in SplitApp.

I have 5 XML views.I want to bind master and detail view.I am using OData model.

 

sapp.JPG

In Master.controller.js code is....

 

handleListItemPress : function (evt) {  var context = evt.getSource().getBindingContext();  this.nav.to("Detail", context);

 

In SplitApp.controller.js

 

to : function (pageId, context) {  this.app = this.getView().idRoot;  // load page on demand  var master = ("Master" === pageId);  if (this.app.getPage(pageId, master) === null) {  var page = sap.ui.view({  id : pageId,  viewName : "sap.ui.ghmsad" + pageId,  type : "XML"  });  page.getController().nav = this;  this.app.addPage(page, master);  jQuery.sap.log.info("app controller > loaded page: " + pageId);  }  // show the page  this.app.to(pageId);  // set data context on the page  if (context) {  var page = this.app.getPage(pageId);  page.setBindingContext(context);  }  }

I am getting an error with function to(). "cannot read property 'to' of undefine".

But same code is working for JSON Model.

 

 

Thanks,

Prashant


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>