메뉴 건너뛰기

SAP 한국 커뮤니티

Ch23. 05번 onUpdate 설정

감자깡 2025.09.23 15:19 조회 수 : 1

sap.ui.define([

    "ea/zcertemp/controller/BaseController",

    "sap/m/MessageToast",

    "sap/m/MessageBox"

],

function (BaseController, MessageToast, MessageBox) {

 

...

 

 

 

        onUpdate: function () {

            const oModel = this.getView().getModel();

            const oSmartForm = this.getView().byId("SF1");

 

            if(oSmartForm.check().length > 0)

                return;

       

            oModel.submitChanges({

                success: function () {

                    MessageToast.show("성공적으로 업데이트되었습니다.");

                    oSmartForm.setEditable(false);

                }.bind(this),

                error: function (oError) {

                    var oMsg = JSON.parse(oError.responseText);

                    MessageBox.error(oMsg.error.message.value);

                }

            });

        }