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


I have this piece of code to show some messages:

var osi = skuid.model.getModel('osi'); var row =[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 =[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?

See these posts:……

Thanks!! it’s working!