Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.1 KB

Using_Dialogs_Defined_as_Fragments_aeb86c1.md

File metadata and controls

28 lines (18 loc) · 1.1 KB
loio
aeb86c181b9742a2bf88049abf9ccb95

Using Dialogs Defined as Fragments

The fragment instantiation function always returns the fragment's root control, which is a dialog control that can be used like any dialog.


In the following example, the dialog is opened immediately:

// "this" has to be the controller instance of a controller extending module "sap/ui/core/mvc/Controller"
this.loadFragment({type: "XML", name: "testdata.fragments.XMLFragmentDialog"}).then(function(oDialog) {
	oDialog.open();
});

Note:

Any global model and any models set on the controller's view are automatically available for data binding within this dialog. The fragment content is automatically added to the view's dependents aggregation. In consequence, the dialog is also automatically destroyed once the view is destroyed.