0% found this document useful (0 votes)
42 views1 page

Defining Dialogs As Fragments 0457545

This document discusses how to define dialogs using fragments in SAPUI5. It provides an XML fragment example where the root control is a dialog with text and buttons. It also shows a JavaScript fragment example where the createContent method returns a dialog control with an input and close button. Fragments allow reusable dialog definitions that can be opened from different locations.

Uploaded by

zzg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views1 page

Defining Dialogs As Fragments 0457545

This document discusses how to define dialogs using fragments in SAPUI5. It provides an XML fragment example where the root control is a dialog with text and buttons. It also shows a JavaScript fragment example where the createContent method returns a dialog control with an input and close button. Fragments allow reusable dialog definitions that can be opened from different locations.

Uploaded by

zzg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

loio

04575456e15e426d81054805990c7a53
view on: demo kit nightly build | demo kit latest release

Defining Dialogs as Fragments


You can use fragments for the definition of dialogs.

To use fragments for defining popups, just let the root control of the fragment be a dialog or
similar control.
The following shows an XML fragment dialog example:
<Dialog xmlns="sap.m" title="XML Fragment Dialog">
<TextView text="{/dialogText}" />
<buttons>
<Button text="Close" press="closeDialog"/>
</buttons>
</Dialog>

Other fragment types are used the same way to define, for instance, a dialog as fragment.
For example, in JS fragments, the createContent() method returns a dialog control:

sap.ui.jsfragment("testdata.fragments.JSFragmentDialog", {
createContent: function(oController) {
var oDialog = new sap.m.Dialog({
title: "JavaScript Fragment Dialog",
content: [
new sap.m.Input({
text: "{/dialogText}"
})
],
buttons: [
new sap.m.Button({
text: "Close",
press: function(){
oDialog.close();
}
})
]
return oDialog;
}
});

You might also like