javascript - How can I destroy a fragment (or a view)? -


i have created fragment:

var dialogfrafment = sap.ui.xmlfragment(     "appintra.fragment.dialog",     this.getview().getcontroller() // associate controller fragment             ); this.getview().adddependent(dialogfrafment); sap.ui.getcore().byid("idmailreport").setvalue(sap.ui.getcore().getmodel("mailuser"));  dialogfrafment. dialogfrafment.open(); 

how can delete after complete?

store dialogfrafment in controller.

if(!this.dialogfrafment) {     this.dialogfrafment = sap.ui.xmlfragment(         "appintra.fragment.dialog",         this.getview().getcontroller() // associate controller fragment                 );     this.getview().adddependent(dialogfrafment);     sap.ui.getcore().byid("idmailreport").setvalue(sap.ui.getcore().getmodel("mailuser")); }   this.dialogfrafment.open(); 

destroy fragment in onexit function of controller.

onexit: function() {     if (this.dialogfrafment) {         this.dialogfrafment.destroy(true);     }  }, 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -