当前位置:网站首页>Use SAP ui5 application to consume create and delete operations of OData in business application studio
Use SAP ui5 application to consume create and delete operations of OData in business application studio
2022-07-25 01:55:00 【InfoQ】

Home.view.xml<Button id="createButton" icon="sap-icon://add" tooltip="Create" visible="true" press="onOpenAddDialog">



onOpenAddDialog: function () {
this.getView().byId("OpenDialog").open();
},
onCancelDialog: function (oEvent) {
oEvent.getSource().getParent().close();
},
onCreate: function () {
var oSo = this.getView().byId("idSo").getValue();
if (oSo !== "") {
const oList = this._oTable;
const oBinding = oList.getBinding("items");
const oContext = oBinding.create({
"soNumber": this.byId("idSo").getValue(),
"customerName": this.byId("idCustName").getValue(),
"customerNumber": this.byId("idCustomer").getValue(),
"PoNumber": this.byId("idPo").getValue(),
"inquiryNumber": this.byId("idInqNumber").getValue()
});
oContext.created()
.then(()=>{
// that._focusItem(oList, oContext);
this.getView().byId("OpenDialog").close();
});
}else {
MessageToast.show("So cannot be blank");
}
},
this._oTableonInitthis._oTable = this.byId("table0");




<Button id="deleteButton" icon="sap-icon://delete" tooltip="Delete" visible="false" press="onDelete">
<Button id="editModeButton" visible="true" icon="sap-icon://edit" tooltip="Edit" press="onEditMode">

onEditMode: function(){
this.byId("editModeButton").setVisible(false);
this.byId("saveButton").setVisible(true);
this.byId("deleteButton").setVisible(true);
this.rebindTable(this.oEditableTemplate, "Edit");
}
onDeleteonDelete: function(){
var oSelected = this.byId("table0").getSelectedItem();
if(oSelected){
var oSalesOrder = oSelected.getBindingContext("mainModel").getObject().soNumber;
oSelected.getBindingContext("mainModel").delete("$auto").then(function () {
MessageToast.show(oSalesOrder + " SuccessFully Deleted");
}.bind(this), function (oError) {
MessageToast.show("Deletion Error: ",oError);
});
} else {
MessageToast.show("Please Select a Row to Delete");
}
},
$autosap.ui.define(["sap/ui/model/odata/v4/ODataModel"], function (ODataModel) {
var oModel = new ODataModel({
serviceUrl : "/sap/opu/odata4/IWBEP/V4_SAMPLE/default/IWBEP/V4_GW_SAMPLE_BASIC/0001/",
synchronizationMode : "None",
updateGroupId : "myAppUpdateGroup"
});
});
边栏推荐
- Take C language from 0 to 1 - program structure and use examples
- When sharing a folder, the 'attempt to share xxxxx
- Agreement on sharing agricultural scientific data in China
- Redis tutorial
- Research 280+ documents! The team of Tsinghua Huang Gao, the winner of CVPR best paper, proposed the first dynamic network overview to comprehensively review the development of dynamic networks!
- [leetcode] 3. Longest substring without repeated characters - go language problem solution
- Specificity and five applications of Worthington alcohol dehydrogenase
- Musk responded whether he would upload his brain to the cloud: already did it!
- Example analysis of recombinant monoclonal antibody prosci CD154 antibody
- How to obtain workers' coats and helmets in stray? How to obtain workers' helmets
猜你喜欢

【Power Shell】Invoke-Expression ,Invoke-Expression -Command $activateCommand; Error or power shell failed to activate the virtual environment

Musk responded whether he would upload his brain to the cloud: already did it!

Target segmentation for 10000 frames of video, less than 1.4GB of video memory, open source code | ECCV 2022

Service address dynamic awareness of Nacos registry

iptables :chains, target

Three modes of executing programs, memory and cache

Open source demo | release of open source example of arcall applet

Pychart exits pytest mode (run pytest in mode)

Research 280+ documents! The team of Tsinghua Huang Gao, the winner of CVPR best paper, proposed the first dynamic network overview to comprehensively review the development of dynamic networks!

EasyX realizes button effect
随机推荐
[hero planet July training leetcode problem solving daily] 20th BST
1260. Two dimensional grid migration: simple construction simulation problem
Today in history: the kotlin language was published for the first time; The father of the IMAP agreement was born; CT imaging achieves a new breakthrough
Grpc sets connection lifetime and server health check
Google launched another "man grabbing war" for core making, and Intel's 17 year veteran joined!
Green low-carbon Tianyi cloud, a new engine of digital economy!
The most complete summary of MySQL data types in history - (first)
Create the first hbuilder project
iptables :chains, target
July 8, 2022
DotNetCore. Cap notes
[summer daily question] output of Luogu p1157 combination
[28. Maximum XOR pair]
Contemporary fairy quotations
PostgreSQL views tables, table indexes, views, table structures, and parameter settings
"I gave up programming and wrote a 1.3 million word hard science fiction."
[C + + primer notes] Chapter 6 functions
Data management process model of science and technology planning project
About the relationship between parent process and child process (UAC bypass idea)
Hbuilderx developed by uni app connects to night God simulator