Skip to Content
-1
May 29, 2020 at 09:21 PM

Close is not working for Dialog fragment SAP UI5

1597 Views

Close is not working and here is my fragment code. Please suggest and tried multiple ways. Also, on the console i'm not getting any errors, it just shows buzy mode(kind of infinie loop) and screen is hanged when i click on close();

<beginButton>
        <Button id="idclsSonar" text="Close" press="onCloseSonar" type="Emphasized"/>
    </beginButton>

Controller code:

_oSonareDialog: function () {
        if (!this._oSDialog) {

            this._oSDialog = sap.ui.xmlfragment(this.getView().getId(),
                "scp.com.saparate.view.fragments.SonarReport", this);
            this.getView().addDependent(this._oSDialog);
        }

        return this._oSDialog;
    },
//onCloseSonar: function () {

        this.getView().byId("idSonardlg").close();

    },
onCloseSonar: function () {

        //this.getView().byId("idSonardlg").close();
       //this._oSonareDialog().close();
//sap.ui.getCore().byId("__xmlview0--idSonardlg").close();

 

},