我有花DB一個表,暴露它作爲xsodata服務如何更新按鈕點擊表或模型
service {
"schema"."table" as "OrderItem";
}
顯示在UI5應用作爲
var Model = new sap.ui.model.json.JSONModel("../../services/myexp.xsodata/OrderItem", false);
sap.ui.getCore().setModel(Model,'myitem');
var oTemplate = new sap.m.ColumnListItem({
cells : [
new sap.m.Text({text : "{myitem>Component}"}),
new sap.m.Text({text : "{myitem>Customer}"}),
new sap.m.Text({text: "{myitem>Required Date}"}),
new sap.m.Text({text : "{myitem>Status}"})
]
});
oTable.bindItems("myitem>/d/results", oTemplate);
現在在圖像中,我在頁面頁腳處添加了兩個按鈕作爲
footer: new sap.m.Bar({
contentRight: [
new sap.m.Button({text: "Accept",type: sap.m.ButtonType.Accept}),
new sap.m.Button({text: "Reject",type: sap.m.ButtonType.Reject})
]
})
現在我的問題是如何更新單擊任何按鈕狀態列,說如果我按接受狀態將更改爲接受和拒絕相同。 (更新模型,我猜hana表會自動更新爲tyhe表暴露爲odata模型)
注意這張表只會有一行。
謝謝
是否要更新服務器上的數據還是隻有模型中的數據? – Rayon