Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 7856

How to show two different JSON models data in same UI5 Page

$
0
0

Hi Friends,

 

I have two different JSON models one is Header and another one is Item details, right now there is no relationship between two models.

 

I Created an UI page using XML format. In UI page There is two components 1) List 2) Table. I need to bind the Header data into List, Item details data in Table. How to bind the data to UI?

I try to bind the data using "items" attribute, but always showing Headers data only. What is the syntax to specific JSON to binding the data to specific UI component?

 

XML Layout :

<List  items="{/results}" > ....... </List><Table items="{/results}" noDataText="Details Not Available"></Table>

 

JSON Objects :

var headerModel= new sap.ui.model.json.JSONModel();
sap.ui.getCore().setModel(headerModel, "oHeaderDataModel");
var detailsModel= new sap.ui.model.json.JSONModel();
sap.ui.getCore().setModel(detailsModel, "oDetailsDataModel");

 

Before Navigating to Target View I'm setting headerModel to View.

 

var view2 = sap.ui.getCore().byId('TargetView');
view2.setModel(headerModel);

 

How to specify the "oHeaderDataModel" to List View as well as "oDetailsDataModel" to Table.

 

Thanks in Advance,

Venu.


Viewing all articles
Browse latest Browse all 7856

Trending Articles



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