RE - attachObject

Hi,

I have this function for creating a new window and attaching an object.

function windc() {
dhxWins = new dhtmlXWindows();
dhxWins.enableAutoViewport(true);
dhxWins.setImagePath(“codebase/imgs/”);
w1 = dhxWins.createWindow(“w1”, 20, 30, 320, 240);
w1.setText(“dhtmlxWindow”);
w1.center();
w1.attachObject(‘winobj’);
}

At first call it works and the window is created, but if I close it and call the function again the window appears with the title but blank.

Is there another way of doing this?

Thank you!
JP

Hi,

close button removes a window and its content. You may redefine this behaviour:

w1.attachEvent("onClose",function(){ w1.hide(); })

And when the window needs being shown again you may call show() method:

w1.show();