adding element with duplicate id

后端 未结 3 1430
野的像风
野的像风 2021-01-15 07:05

I am creating a SAP Fiori application. I have input in a dialog box in that I have to fetch the input value. I am defining the dialog

3条回答
  •  终归单人心
    2021-01-15 08:04

    It is also a good idea to add your fragment as dependant to your main view. This way it will be destroyed when the main view is destroyed. And you will not get duplicate id error when navigating away from your view and back.

    DialogButton:function(oEvent) {
       if(!this.oDialog) {
          this.oDialog =  sap.ui.xmlfragment("you.dialog.id", this );
          this.getView().addDependent(this.oDialog);
       }
       this.oDialog.open();
    }
    

提交回复
热议问题