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

Problems binding items in a table

$
0
0

I have a master/detail page showing orders in the master list and order details in the details.  The top of the detail view is a form with the header details and that works, updating when I click an order.  Below the header I have a sap.m.table control and I can't get that to work.  Just to make sure the service worked I tried this:

 

<Table id="idOrderDetailsTable" items="{gbi>/SalesOrders('1001')/Details}'>

 

That works.

 

To get it to update I tried this:

 

oRouteMatched: function(oEvent){

 

...

  var sEntityPath = "/" + oParameters.arguments.entity;

  var oForm = oView.byId("idSimpleFormDisplay");

  var context1 = new sap.ui.model.Context('gbi',sEntityPath);

  oForm.setBindingContext(context1,'gbi');  //This works

 

  var oTable = this.getView().byId('idOrderDetailsTable");

  var context2 = new sap.ui.model.Context('gbi' , sEntityPath +  "/Details");  //sEntiryPath = '/SalesOrders('<ordernumber>')

  oTable.setBindingContext(context2,gbi); //This doesn't work

 

If I watch it execute in Chrome's developer tools, it looks like it's working. This is in the console after the last line above executes:

 

Region Capture.png

However, the binding info for the table in SAPUI5 Diagnostics says there is no binding and there is no data showing.  I'm beginning to get my head around SAPUI5 in general but this binding is still somewhat of a mystery especially since most of the examples are for JavaScript views.

 

Thanks,

 

Ross


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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