cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Dialog - Uncaught TypeError: Cannot read property 'render' of undefined

former_member190882
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

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.

former_member190882
Participant
0 Kudos

Thanks Sai for your input. It satisfied the requirement.


-Maruthi

Answers (1)

Answers (1)

Former Member
0 Kudos

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.