SAP공장

sap ui5 popup, FragMent 본문

[SAP]ABAP/ABAP 강의 SYNC

sap ui5 popup, FragMent

ABAP,ODATA,BTP 2022. 8. 23. 16:18
반응형

1> PopUp

        <!-- PopUp -->
        <Button text="POPUP Button" press="onPopup"></Button>
 

<core:FragmentDefinition

    xmlns"sap.m"
    xmlns:core="sap.ui.core"
>
    <Dialog id="idPopup" title="Popup">
        <buttons>
            <Button text="Close" press="onClose"/>
        </buttons>
        <content>
            <Text text="Popup View"/>
        </content>
    </Dialog>
 
</core:FragmentDefinition>

sap.ui.define([
    "sap/ui/core/mvc/Controller",
    "sap/ui/core/Fragment"
],
    /**
     * @param {typeof sap.ui.core.mvc.Controller} Controller
     */
    function (ControllerFragment) {
        "use strict";

        return Controller.extend("Train.zse0706.controller.View1", {
            onInit: function () {

            },
            onMain: function () {
                let oInpMain = this.getView().byId("inpMain");
                let oInpFrag = this.getView().byId(
                    Fragment.createId("idFragView","inpFrag")
                    );

                alertoInpMain.getValue());
                alertoInpFrag.getValue());
            },
            onFrag: function (){
                alert("fragment Button");
                let oInpMain = this.getView().byId("inpMain");
                let oInpFrag = this.getView().byId(
                    sap.ui.core.Fragment.createId("idFragView""inpFrag")
                    );

                alertoInpMain.getValue());
                alertoInpFrag.getValue());
            },
            
            onPopup: function (){
                let oView = this.getView();

                if(!this.byId"idPopup" )){
                    Fragment.load({
                        id: oView.getId(),
                        name: "Train.zse0706.view.Popup",
                        type: "XML",
                        controller: this
                    }).then(
                        function ( oPopup ){
                            oView.addDependentoPopup );
                            oPopup.open();

                        }
                    );
                } else {
                    this.byId"idPopup").open();
                    
                }
            },
            onClose: function (){
                this.getView().byId"idPopup" ).close();
            }
        });
    });

2> Fragment

     <!-- Fragment -->
        <core:Fragment
            id="idFragView"
            fragmentName="Train.zse0706.view.Frag"
        />

<core:FragmentDefinition
    xmlns"sap.m"
    xmlns:mvc="sap.ui.core.mvc"
    xmlns:core="sap.ui.core"
>

    <Label text="Fragment"/>
    <Input id="inpFrag" value="WH"/>
    <Button text="Frag Button" press="onFrag"/>
    
</core:FragmentDefinition>   

sap.ui.define([
    "sap/ui/core/mvc/Controller",
    "sap/ui/core/Fragment"
],
    /**
     * @param {typeof sap.ui.core.mvc.Controller} Controller
     */
    function (ControllerFragment) {
        "use strict";

        return Controller.extend("Train.zse0706.controller.View1", {
            onInit: function () {

            },
            onMain: function () {
                let oInpMain = this.getView().byId("inpMain");
                let oInpFrag = this.getView().byId(
                    Fragment.createId("idFragView","inpFrag")
                    );

                alertoInpMain.getValue());
                alertoInpFrag.getValue());
            },
            onFrag: function (){
                alert("fragment Button");
                let oInpMain = this.getView().byId("inpMain");
                let oInpFrag = this.getView().byId(
                    Fragment.createId("idFragView""inpFrag")
                    );

                alertoInpMain.getValue());
                alertoInpFrag.getValue());
            },

            onPopup: function (){
                let oView = this.getView();

                if(!this.byId"idPopup" )){
                    Fragment.load({
                        id: oView.getId(),
                        name: "Train.zse0706.view.Popup",
                        type: "XML",
                        controller: this
                    }).then(
                        function ( oPopup ){
                            oView.addDependentoPopup );
                            oPopup.open();

                        }
                    );
                } else {
                    this.byId"idPopup").open();
                    
                }
            },
            onClose: function (){
                this.getView().byId"idPopup" ).close();
            }
        });
    });

 

반응형

'[SAP]ABAP > ABAP 강의 SYNC' 카테고리의 다른 글

bit cockpit 과 abap system 연결하기(Terminal code + sicf)  (0) 2022.08.26
web dynpro (update)  (0) 2022.08.16
abap screen.  (0) 2022.08.04
abap module에 변수를 선언하지 말것  (0) 2022.08.03
alv change( event )  (0) 2022.08.01
Comments