Hi Experts,
In SAPUI5 SDK demo kit, the same codes are in XML view. I tried to search the API or library for XML view i could not find. The data binding in XML views are not clear.
e.g. Table.view.xml
<mvc:View
controllerName="sap.m.sample.Table.Table"
xmlns:l="sap.ui.layout"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m">
<Table id="idProductsTable"
inset="false"
items="{
path: '/ProductCollection',
sorter: {
path: 'Name'
}
}">
<headerToolbar>
<Toolbar>
<Label text="Products"></Label>
</Toolbar>
</headerToolbar>
<columns>
<Column
width="12em">
<Text text="Product" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Supplier" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true"
hAlign="Right">
<Text text="Dimensions" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true"
hAlign="Center">
<Text text="Weight" />
</Column>
<Column
hAlign="Right">
<Text text="Price" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<ObjectIdentifier
title="{Name}"
text="{ProductId}"
class="sapMTableContentMargin" />
<Text
text="{SupplierName}" />
<Text
text="{Width} x {Depth} x {Height} {DimUnit}" />
<ObjectNumber
number="{WeightMeasure}"
unit="{WeightUnit}"
state="{
path: 'WeightMeasure',
formatter: 'sap.m.sample.Table.Formatter.weightState'
}" />
<ObjectNumber
number="{Price}"
unit="{CurrencyCode}" />
</cells>
</ColumnListItem>
</items>
</Table>
</mvc:View>
jQuery.sap.require("sap.m.sample.Table.Formatter");
sap.ui.controller("sap.m.sample.Table.Table", {
onInit: function () {
// set explored app's demo model on this sample
var oModel = new sap.ui.model.json.JSONModel("test-resources/sap/ui/demokit/explored/products.json");
this.getView().setModel(oModel);
}
});
How can we bind multiple data sources in xml
Thank You
Regards
Senthil Bala