Dhtmlx window inner focus

Hi,

I do not manage to solve a problem with an inner focus in dhtmlx window.

I made a fonctionnne with attachobj, i want to set focus in a textarea in the object (div).

My code is :

[code]
function openInFullText(obj,txtorigin,txtnew) {
if (!dhxWins0) dhxWins0 = new dhtmlXWindows();
if (!dhxWins0.window(“w0”)) {
dhxWins0.enableAutoViewport(false);
dhxWins0.setSkin(“dhx_web”);
dhxWins0.attachViewportTo(“winVP”);
dhxWins0.setImagePath(“tools/dhtmlxwindows/codebase/imgs/”);
var w0 = dhxWins0.createWindow(“w0”, 0, 0, 900, 700);
w0.setModal(true);
w0.setText(" ");
w0.center();
w0.clearIcon();
w0.denyResize();
w0.button(“minmax1”).hide();
w0.button(“park”).hide();
w0.denyMove();
w0.denyPark();

w0.attachEvent("onClose", function(win){
	if (win.getId() == "w0") {
		win.detachObject(obj);
		document.getElementById(txtnew).style.display="none";
		win.setModal(false);
		win.hide();
	}
});

} else {
var w0 = dhxWins0.window(“w0”);
w0.setModal(true);
w0.show();
}
w0.attachObject(obj);
document.getElementById(txtnew).value=document.getElementById(txtorigin).value;
document.getElementById(txtnew).style.display=“block”;

document.getElementById('TXTDESCRIPTION').focus();

};[/code]

I call it like this for exemple :

onClick="openInFullText('divdescription','O_CALL.F_DESCRIPTION','TXTDESCRIPTION');"

And this is my div called in the window :

[code]




[/code]

With this, when window show, focus is behind the window but visible (example in attach).

I tried bringtotop issu, tried to make “click()” to set focus, etc. But it doesn’t work.

And i have a second probleme, in my textarea, i can’t make selections with cursor on IE8. I can make a ctrl+A but just a selection don do anything.

I hope you can help me…

Thank you!!!

(for info, i work with dhtmlx suite pro v2.6)

Hi
Could you attach completed demo to reproduce your issue, plese?
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hi,

ok it is in attach.

The problem is with IE8 and IE9.

I appreciate your help! :slight_smile:
thanks
DEMO.zip (579 KB)

Hi

Try this:

window.setTimeout(function(){ document.getElementById('TXTDESCRIPTION').focus(); },1)

Thank yous very much, it works with this! :wink:
I haven’t think to do a setTimeout…

Now i still have my second problem :

Ctrl+A works and shift+right or left works to do selections but not with mouse… :unamused:

Can you help me for this too please?

The issue is reproduced, but it is solved in the version 3.0

Thank you, it works fine now!