Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by John Taggart on Mar 29, 2008 12:15
open dhtmlx forum
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.
Answer posted by Support on Mar 31, 2008 05:09
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.
Answer posted by John Taggart on Mar 31, 2008 20:04

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

Attachments (1)
Answer posted by Arun B on May 13, 2009 14:15
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);
Answer posted by Alex (support) on May 14, 2009 00:45

What problem did you get exactly ?

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

Attachments (1)