on 10-08-2015 2:24 PM
Hi All,
I am trying to use simple message Dialog Box in my application and unfortunately landing into the following error.
Error: Uncaught TypeError: Cannot read property 'render' of undefined
when I try to open the dialog box using confirmDialog.open();. My code goes as follows.
var confirmDialog = new sap.m.Dialog(
{
title : "Confirm Reject",
type : sap.m.DialogType.Message,
content : [new Text({ text: 'Are you sure you want to reject the resoures?' }),],
beginButton : new sap.m.Button(
{
text : "YES",
tap : [
function(oEvent) {
yesOnNo = "YES";
confirmDialog.close();
}, this ],
press : [
function(oEvent) {
yesOnNo = "YES";
confirmDialog.close();
}, this ]
}),
endButton : new sap.m.Button(
{
text : "NO",
tap : [
function(oEvent) {
yesOnNo = "NO";
confirmDialog.close();
return;
}, this ],
press : [
function(oEvent) {
yesOnNo = "NO";
confirmDialog.close();
return;
}, this ]
}),
afterClose : [ function(oEvent) {
confirmDialog.destroy();
}, this ]
});
confirmDialog.open();
Please help me fix the issue.
Thanks
Maruthi
Hi Maruthi,
For Validation, why are you using a Dialog? Instead you can use sap.m.MessageBox.confirm.
Check this sample - Validation Sample
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I just stumbled about this issue and would like to share the solution that allows using the dialog:
In line 5 you create a new text element but you don't use the correct path.
As you do in line 1 with the dialog, you also have to instantiate the text object by using
new sap.m.Text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.