我创建了这个片段:
var dialogFrafment = sap.ui.xmlfragment(
"appIntra.fragment.dialog",
this.getView().getController() // associate controller with the fragment
);
this.getView().addDependent(dialogFrafment);
sap.ui.getCore().byId("idMailReport").setValue(sap.ui.getCore().getModel("mailUser"));
dialogFrafment.
dialogFrafment.open();
如何在完成后将其删除?
答案 0 :(得分:4)
将dialogFrafment存储在控制器中。
if(!this.dialogFrafment) {
this.dialogFrafment = sap.ui.xmlfragment(
"appIntra.fragment.dialog",
this.getView().getController() // associate controller with the fragment
);
this.getView().addDependent(dialogFrafment);
sap.ui.getCore().byId("idMailReport").setValue(sap.ui.getCore().getModel("mailUser"));
}
this.dialogFrafment.open();
在控制器的onExit函数中销毁片段。
onExit: function() {
if (this.dialogFrafment) {
this.dialogFrafment.destroy(true);
}
},