dhtmlxwindows

How can I attachObject more than once? I’m tryingto display different text in body each time I open window.



e.g.



    var dhxWindow = dhxWins.createWindow(“dhxWindow”, 440, 145, 300, 200);

    dhxWindow.setModal(true);

    dhxWindow.setText(“Message label”);

    dhxWindow.attachObject(‘viewMessageDiv’,true);



After I close window and then want to create another window and attachObject to display text in window I get following error:



Error: Invalid pointer



Thanks.

If you attached some content to the window, and closed window after that - the content of window will be destroyed, and will not be available anymore, so you will not be able to reuse it in next window.
If you need to reuse some content you can use hide|show commands of window, instead of closing.


I’m using setModal(true). When use hide() method modal properties still apply.



I have come up with a solution that works with setModal(true). Basically it creates the object to attach each time window is created.



I have attached script.



Regards,



John


showDhtmlxWindow.js.zip (1.07 KB)

I had similar problem but I used attachHTMLString instead of attachObject.

var dhxWindow = dhxWins.createWindow(“dhxWindow”, 440, 145, 300, 200);

    dhxWindow.setModal(true);

    dhxWindow.setText(“Message label”);

    dhxWindow.attachHTMLString(document.getElementById(‘viewMessageDiv’).innerHTML);


What problem did you get exactly ?


We have attached the sample - it seems that all is correct here.


1242287160.zip (55.1 KB)