Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Mark Ritter on Jul 13, 2008 20:30
open dhtmlx forum
Strange FORM behavior

I am using this with an HTA application I am writing, WPI, to open an information window on top of the main window. Everything is working fine, except when I click into a TEXT or TEXTAREA input field, it will not be accepted unless click somewhere other than the end. These fields are not in the dhxWindow.

If I click in the center of an existing string, it works. If I click at the end of the string to add more text, it does not work. If the text box is blank, can't do anything. This happens with the window open or closed. All other buttons work fine.

    VPWindow = new dhtmlXWindows();
    VPWindow.enableAutoViewport(true);
    VPWindow.setImagePath("./Common/imgs/Windows/");
    VPWindow.setSkin("standard")

    InfoWindow = VPWindow.createWindow("InfoWindow", 50, 50, 600, 410);
    InfoWindow.setText("Information");
    InfoWindow.attachObject("layerinformation"); // a <div>

//v.1.0 build 80319

Answer posted by Support on Jul 14, 2008 04:02
Please try to use dhtmlxwindow.js from next thread
    http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=2762&ssr=yes&s=dhtmlxwindow
it must resolve issue with selection blocking
Answer posted by Mark Ritter on Jul 15, 2008 18:56

That fixed the above problem.

But now when I maximize the window I get an error here:

 this._redrawWindow = function(win) { win.style.left = win.x + "px"; win.style.top = win.y + "px"; win.style.width = win.w + "px"; win.style.height = win.h + "px";

Invalid argument for

win.style.width = win.x + "px";

=============================

I also do an attachEvent("onFocus",SetActiveWindow);

function SetActiveWindow(win)
{
 position="main.js";
 whatfunc="SetActiveWindow()";

 ActiveWindow=win.getText();
}

Says Objext doesn't support this property or method.  Yet your demos work fine.

Same code as posted in original message.

 

Answer posted by Support on Jul 16, 2008 02:43
Unfortunately both issue can't be reconstructed locally.
Please try to use attached js file instead of original one, if problem still occurs - please provide any kind of sample where it can be reconstructed ( you can send it directly to support@dhtmlx.com )
Attachments (1)
codebase.zip15.56 Kb
Answer posted by Mark Ritter on Jul 17, 2008 20:36

That new code fixed the maximize issue.

But now attachObject() has no affect; just a blank gray window.  attachURL() works fine.

win.getText() still has error message.

 

Answer posted by Support on Jul 18, 2008 03:02
The issues can't be reconstructed locally, both setObject and getText works as expected in local samples.
If problem still occurs for you - please provide any kind of sample where issue can be reconstructed.
Answer posted by Mark Ritter on Jul 19, 2008 15:35

If I used this code, attachObject() will not work:

 var newDiv = document.createElement("div");
 var objDiv = document.getElementById("layergroup");

 newDiv.id="layerabout";
 newDiv.style.position="absolute";
 newDiv.style.display="none";
 newDiv.style.overflow="auto";
 newDiv.style.width="100%";
 newDiv.style.height="100%";

If I use this, it works:

 var newDiv = document.createElement("div");
 var objDiv = document.getElementById("layergroup");

 newDiv.id="layerabout";
 newDiv.style.display="none";
 newDiv.style.overflow="auto";

newDiv.style.position="relative";    works also.

It has to do with the style position.  It works fine with my program now.

 

Answer posted by Mark Ritter on Jul 20, 2008 08:41

I am still having problems with

 VPWindow = new dhtmlXWindows();
 VPWindow.enableAutoViewport(true);
 VPWindow.setImagePath("./Common/imgs/Windows/imgs/");
 VPWindow.setSkin("clear_silver");
 VPWindow.attachEvent("onFocus",SetActiveWindow);

function SetActiveWindow(win)
{
 position="main.js";
 whatfunc="SetActiveWindow()";

 ActiveWindow=win.getText();
}

I can't do anything with the win variable. 

 VPWindow.attachEvent("onFocus",function(win) { ActiveWindow=win.getText(); } );

does not work either.

Could there be a conflict with one of your other modules?  I am using almost all of them in my program.

 

Answer posted by Support on Jul 21, 2008 03:07
Problem confirmed, the onFocus event called during window creation and window object is not fully operable in such moment, you can try to use attached js file instead of original one.
Attachments (1)
Answer posted by Mark Ritter on Jul 21, 2008 15:23

Working better.  No more error message.

But, the onFocus happens too soon.  It doesn's allow the window title to be set, so the initial win.getText() is always "Untitled dhtmlxWindow".

If I open a second window, same thing.  Focus the first window, title is returned correctly.

Getting close.......

 

Answer posted by Support on Jul 22, 2008 02:14
The window come in focus immideatly after creation, so it calls onFocus in same moment.
The text of header set by separate command, after win. creation, so it occurs after onFocus event - technically, it is a correct behavior.