on 09-12-2016 8:01 PM
Hi Experts,
I have an entity set HeaderSet with sale orders and item entity set ItemSet. I have defined the navigation sets, so that automatic expand happens using framework. It worked everything fine from gateway perspective. I'm displaying sale orders as an table and by choosing the order, i want to display items. I checked in debugging that when i select the sale order, expand is working fine and properly returning the corresponding sale order items. Here, problem is i could not able to see the data in the item table. It is problem with the binding. Please check the code here.
GatewayService: /sap/opu/odata/sap/ZORDER_SRV/HeaderSet('1')?$expand=ItemSet01 working fine.
Skeleton Code under controller:
//Template to map the data to the respective column
var template2 = new sap.m.ColumnListItem({
id: "second_template",
type: "Navigation",
visible: true,
cells: [
new sap.m.Label("ID2", {
text: "{M2>Vbeln}"
}),
new sap.m.Label({
text: "{M2>Posnr}"
}),
new sap.m.Label({
text: "{M2>Product}"
}),
new sap.m.Label({
text: "{M2>Total}"
})
]
});
var oFilters = null;
//For Odata model
oTable2.bindItems( "M2>/",template2, null, oFilters);
Code Under View:
var arrParams = ["$expand=ItemSet01"];
var sServiceUrl2 = "http://PUNSEZSAPVM31.ad.infosys.com:8010/sap/opu/odata/sap/ZORDER_SRV";
var oModel2 = new sap.ui.model.odata.ODataModel(sServiceUrl2,true);
// here sItemName coming when we select the order which is working properly
oModel2.read("/HeaderSet('" + sItemName + "')?", null,arrParams,
false,function(oData2, oResponse){
list2 = oData2.results; });
console.log(list2);
var oJsonModel2 = new sap.ui.model.json.JSONModel();
oJsonModel2.setData(list2);
sap.ui.getCore().setModel(oJsonModel2,"M2");
Hi k p,
why you are adding oFilter in the bindItems if there is no filter ...
try this :
oTable2.bindItems( "M2>/",template2);
thanks
Viplove
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.