在Doc of Descripter中,odataVersion
的{{1}}中只有localUri
,annotations
,maxAge
和settings
,如果我想在url中添加Date等动态参数?
如:
dataSources
答案 0 :(得分:0)
我用Aggregation Binding解决了这个问题:
//worklist.controller.js
onInit : function(oEvent) {
const oView = this.getView(),
oModel = new sap.ui.model.json.JSONModel(),
oTable = oView.byId("table");
oTable.setBusy(true);
oModel.loadData("getData?Date=" + new Date());
oModel.attachRequestCompleted(function() {
oTable.setBusy(false);
});
//Set a name for oModel so that it won't confused with my mainService
oView.setModel(oModel, "myModel");
},
//worklist.view.xml
<Table
id="table"
items="{
path: 'myModel>/'
}">
<columns>
<Column><Text text="ID"/></Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{myModel>ID}"/>
</cells>
</ColumnListItem>
</items>
</Table>