我创建了这个片段:
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();
Run Code Online (Sandbox Code Playgroud)
完成后如何删除?
将您的 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();
Run Code Online (Sandbox Code Playgroud)
销毁控制器 onExit 函数中的片段。
onExit: function() {
if (this.dialogFrafment) {
this.dialogFrafment.destroy(true);
}
},
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
16764 次 |
最近记录: |