cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 Dialog content not displayed

vinodkumar_thangavel
Participant
0 Kudos

Hi Experts,

I am using dialog box for confirmation I am able to get the POP up box but the content is not getting displayed.

Can any one pls let me know am i missing something during the dialog box creation.

Please find the code & screen shot attached.

			var dialog = new Dialog({
				title: "Confirm",
				type: "Message",
				content: new Text({
					text: "Record Already exists,Are you sure you want to continue?"
				}),
				beginButton: new Button({
					text: "Confirm",
					press: function() {
						//Confirm Button Click Event
						dialog.close();
					}
				}),
				endButton: new Button({
					text: "Cancel",
					press: function() {
						//Cancel Button Click Event
						dialog.close();
					}
				}),
				afterClose: function() {
					dialog.destroy();
				}
			});
			this.getView().addDependent(dialog);
			dialog.open();<br>

Accepted Solutions (1)

Accepted Solutions (1)

saurabh_v
Active Participant
0 Kudos

Have you defined the sap.m.Text dependency (AMD) at the beginning of the controller file and added the alias to the controller function? Either do this:

sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/Dialog",
"sap/m/Button",
"sap/m/Text"
], function(Controller, Dialog, Button, Text) {
.......

or replace the Text control declaration within the dialog's content aggregation as below:

....
content: new sap.m.Text({
text: "Record Already exists,Are you sure you want to continue?"
}),
......
vinodkumar_thangavel
Participant
0 Kudos

Thanks a lot this solution worked for me 🙂 .

Answers (0)