当前位置:网站首页>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"
});
});
边栏推荐
- CSRF attack principle scenario
- Why can't reading more books improve your writing?
- Completefuture parallel asynchronous return processing
- The solution of displaying garbled code in SecureCRT
- Top priority of dry goods: common indicators and terms in data analysis!
- AWD thinking
- KVM virtualization jobs
- Prosci anti-CD22 antibody epratuzum28 flow cytometry display
- Introduction to ORM framework - what is ORM framework?
- Point to point copy and paste of web pages
猜你喜欢
![Simulation Implementation of [STL] string class](/img/be/2e4f8dd7da59753e109b38fdf51fba.png)
Simulation Implementation of [STL] string class
![[recognize cloud Nativity] Chapter 4 cloud network section 4.9.4.3 - smart network card usage scenario - network acceleration implementation](/img/9a/b69036bf920706360d8b293dad2a89.png)
[recognize cloud Nativity] Chapter 4 cloud network section 4.9.4.3 - smart network card usage scenario - network acceleration implementation
![[hero planet July training leetcode problem solving daily] 20th BST](/img/25/2d2a05374b0cf85cf123f408c48fe2.png)
[hero planet July training leetcode problem solving daily] 20th BST

EasyX realizes button effect

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

Redis learning notes (2) - power node of station B

Hongmeng harmonyos 3 official announcement: officially released on July 27; Apple slowed down the recruitment and expenditure of some teams in 2023; Russia fined Google 2.6 billion yuan | geek headlin

Using multithreaded execution method in Lua script based on nlua implementation

2022.7.20 linear table

Multi species tissue slide prosci pancreatic tissue solution
随机推荐
Green low-carbon Tianyi cloud, a new engine of digital economy!
Inventory of well-known source code mall systems at home and abroad
G024-db-gs-ins-01 openeuler deployment opengauss (single instance)
[hero planet July training leetcode problem solving daily] 20th BST
From casting sword to defending sword: the way to build the efficiency platform of didi project
Performance analysis method - Notes on top of performance
Leetcode - number of palindromes
Grpc sets connection lifetime and server health check
[basic usage of STL]
[leetcode] 2. Add two numbers - go language problem solving
The importance of system to Philosophy Hegel
Human cell prosci 4-1BB ligand recombinant protein scheme
Upgrade the leapfrog products again, and the 2023 Geely Xingrui will be sold from 113700 yuan
Automatically create partition tables by time and month in PostgreSQL
What are the important trends revealed by the release of "operator data viability index"?
Redis tutorial
Opengauss kernel analysis: query rewriting
The solution of displaying garbled code in SecureCRT
Guide to the construction of network security testing laboratory - Chapter 1, section 1.5 key terms
[29. DFS depth is preferred]