Hi Alex, > --snip-- > bt1.addListener("execute",function() { > var self = this; > this.__field.focus(); > qx.event.Timer.once(function() { > var focusedWidget = > qx.ui.core.FocusHandler.getInstance().getFocusedWidget(); > this.__field.setValue(focusedWidget + ""); > }, self, 0); > },this); > --snip-- > > it should work. >
Thanks for the snippet. I started a new thread and I guess it sorta is confusing. So I'm also sending the snippet with which I could reproduce the problem. I'm using qooxdoo trunk 20400 version. When the window is modal, I get "null" after 1 sec, if I press the "focus" button. If the window is non-modal, I get the textfield. Is there any reason why modality changes the focused widget? Thanks once again for the snippet :) > main : function() { > // Call super class > this.base(arguments); > > // Enable logging in debug variant > if (qx.core.Variant.isSet("qx.debug", "on")) { > // support native logging capabilities, e.g. Firebug for > Firefox > qx.log.appender.Native; > // support additional cross-browser console. Press F7 to > toggle visibility > qx.log.appender.Console; > } > > var layout = new qx.ui.layout.VBox; > layout.setSpacing(10); > var child_container = new qx.ui.window.Window(); > child_container.setHeight(300); > child_container.setWidth(300); > child_container.setModal(true); > child_container.setLayout(layout); > > child_container.open(); > var bt1 = new qx.ui.form.Button("Focus"); > var modality = "Toggle modality"; > var bt2 = new qx.ui.form.Button(modality + > (child_container.isModal()? "(Modal)": "(Not Modal)")); > var field = new qx.ui.form.TextField(); > child_container.add(bt1); > child_container.add(bt2); > child_container.add(field); > bt1.addListener("execute",function(){ > field.focus();setTimeout(function(){ > var fw = > qx.ui.core.FocusHandler.getInstance().getFocusedWidget(); > alert("Focused widget is:" + fw); > field.setValue(fw); > },1000); > },this); > bt2.addListener("execute",function(){ > child_container.setModal((child_container.isModal()? false: > true)); > bt2.setLabel(modality + (child_container.isModal()? > "(Modal)": "(Not Modal)")); > },this); > > > } cheers, skar. -- -- The life so short, the craft so long to learn. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel