Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Dan Obregon on Jan 20, 2010 13:06
open dhtmlx forum
I have a single page that is made of several hidden divs. I have created a popup and want to attach one of the ...

I have a single page that is made of several hidden divs.

I have created a popup and want to attach one of the divs to the popup.
Here is the code that I'm using to accomplish this:

var the_window_id = "a_window_id";
var oWin = top.dhxWins.createWindow(the_window_id, 10, 10, 500, 500);
oWin.setText("Some window title");
oWin.setModal(true);
oWin.centerOnScreen();
var thisLayout = oWin.attachLayout("1C");
            
var parent_win = top.dhxWins.window("parent_id")._frame.contentWindow;
the_div_obj = parent_win.document.getElementById("some_div_id");
thisLayout.cells("a").attachObject(theObj); // => Invalid Argument
// thisLayout.cells("a").attachObject("some_div_id"); // => Invalid Pointer

This works perfectly in Firefox and IE8; however, in IE6 and IE7, I get a javascript error "Invalid Argument" when I try to attachObject. If I try passing in the div_id instead of the div object, I get an "Invalid Pointer" javascript error. I know I'm getting the right object. When i alert the_div_obj.innerHTML, I get all the right html div contents.

Is this a known issue? Have I missed a step? Please help!
Answer posted by Alex (support) on Jan 21, 2010 06:29

Hello 

try to make the object visible before attaching it to the layout.

Answer posted by Dan Obregon on Jan 21, 2010 08:49
Making the object visible did not help solve this problem, but it did give me another idea.

I ended up created a new dhtmlxWindows object to manage the popup.
For some reason, using the parent window manager wasn't working out for me.