:: Forum >>
iFrame modal popup
To try and keep this simple - I have a page with tabs on it, in a tab I dynamically load a grid via AJAX and display via eval. There is a add new record button on this page that pops up a dhtml window (iFrame) for data entry. Once the entry is complete I would like to reference the grid before I close the iframe popup to refresh. In this instance AW.object() is unable to find the grid and returns undefined. I have tried many combinations of parent/window/$owner/etc... with no luck.
Is it possible to get AW.object to work in this situation?
Any help appreciated.
Thanks,
Erik Dobrie
Thursday, February 4, 2010
Hi Erik,
Yes, that's because the grid object variable is defined inside the http.response function, you can get around it by defining a global scope ( page level) variable for the grid. Then you can access it from anywhere you want.
Take the code-tabs example and modify it like this:
var grid,checkbox;
tabs.onSelectedItemsChanged = function(selected){
alert(grid);
var index = selected[0];
Then remove the (2) 'var' commands in page0.htm for grid and checkbox, and you can see the grid_source alert on any tab selection.
HTH
Carlos
Friday, February 5, 2010
Carlos,
Thanks for the quick reply, the example you provided does give visibility to a object on different tabs but the object is still not visible in the popup (iFrame) window.
alert(parent.window.document.getElementById("TAB02XG1")); will return 'object' but I don't know how to then turn this into something I can use for .refresh(), .setCellModel(), etc...
Any idea?
Erik Dobrie
Friday, February 5, 2010
I think you can use:
var objGridFromIframe =parent.window.document.getElementById("gridID");
and then:
objGridFromIframe.refres();
assuming the id for the grid is defined and evaluated in response.
(i.e. in above example in page0.htm)
grid.setId("gridID");
try if alert(objGridFromIframe) just works as I supposed.
HTH
Carlos
Friday, February 5, 2010
This topic is archived.
Back to support forum
Forum search