Window has no method "attachform"

Hi, I’m using the new 3.5 dhmtlx suite, and I´m having troubles attaching a form into a window. I´ll just paste the code, it’s returning : "the object has no method “attachform”. It’s driving me nuts because this is exactly how I used to attach forms into a window in the last version of the suite.

    <script src="../dhtmlx/dhtmlxcommon.js"></script>
    
    <%-- Archivos de Toolbar --%>
    <script src="../dhtmlx/toolbar/dhtmlxtoolbar.js"></script>
    <link rel="stylesheet" type="text/css" href="../dhtmlx/toolbar/skins/dhtmlxtoolbar_dhx_skyblue.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/toolbar/skins/dhtmlxtoolbar_dhx_terrace.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/toolbar/skins/dhtmlxtoolbar_dhx_web.css">
    
    <%-- Archivos de Form --%>
    <link rel="stylesheet" type="text/css" href="../dhtmlx/form/skins/dhtmlxform_dhx_skyblue.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/form/skins/dhtmlxform_dhx_terrace.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/form/skins/dhtmlxform_dhx_web.css"> 
    <script src="../dhtmlx/form/dhtmlxform.js"></script>
    
    <%-- Archivos de Windows --%>
    <link rel="stylesheet" type="text/css" href="../dhtmlx/window/dhtmlxwindows.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/window/skins/dhtmlxwindows_dhx_skyblue.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/window/skins/dhtmlxwindows_dhx_terrace.css">
    <link rel="stylesheet" type="text/css" href="../dhtmlx/window/skins/dhtmlxwindows_dhx_web.css">
    <script src="../dhtmlx/window/dhtmlxwindows.js"></script>
    <script src="../dhtmlx/window/dhtmlxcontainer.js"></script>

<%-- Archivos de JavaScript (Estructuras de los formularios) --%>

    <script>
        try
        {   var skin = "dhx_skyblue";
            
            var toolbar = new dhtmlXToolbarObject('divPUToolBar',skin);
            toolbar.setIconsPath('../dhtmlx/toolbar/imgs/');
            toolbar.loadXMLString('<toolbar><item type="button" id="button_normal_1" text="Button" /></toolbar>', function(){});
                
            var formPUnico = new dhtmlXForm('divPUForm',structurePUnico);
            formPUnico.setSkin(skin);
            
            
           var dhxWins = new dhtmlXWindows();
           var win = dhxWins.createWindow("winAboga", 200 ,200 , 400 , 400);
           dhxWins.setImagePath("../dhtmlx/window/imgs/");
           dhxWins.setSkin(skin);
           dhxWins.window("winAboga").setText("Alta Abogados");
            
          dhxWins.window("winAboga").attachForm(structureAlta);
    
        }
        catch(e)
        {
            alert(e.message);
        } 
    </script>
  
</body>

Hi
Recommend you use the right order of initialization and use different important window’s settings such as viewport:
dhtmlx.com/docs/products/dht … indow.html
It will fix your issue.

Thank you, that pretty much fixed my problem, the order of initialization was the problem thank you :smiley:.

You are welcome!