Skip to main content
Nintex Community Menu Bar
Question

use skuid.model.getModel in a page include in a popup

  • July 9, 2024
  • 2 replies
  • 9 views

Forum|alt.badge.img+7

hi,

I have this piece of code to show some messages:

var osi = skuid.model.getModel('osi'); var row = osi.data[0]; [...] some calculations.... [...] if(txtwarnings!==""){ skuid.$('#txtwarning').html(txtwarnings).addClass('paddings').addClass('warning'); }else{ skuid.$('#txtwarning').html(''); } if(txtOk!==""){ skuid.$('#txtOk').html(txtOk).addClass('paddings').addClass('ok'); }else{ skuid.$('#txtOk').html(''); }

it’s working fine:

But If I include (page include component) this page in a popup in other page this does not work.

Javascript shows this error message:

Uncaught TypeError: Cannot read property ‘data’ of undefined (in line 3)

Line 3 is: var row = osi.data[0];

so var osi = skuid.model.getModel(‘osi’); is returning undefined.

‘osi’ is the model id in the included page and in the parent page that id doesn’t exists.

how can I make this work?