Dietrich Streifert schrieb:
I don't have a qooxdoo solution to this I just manipulate direct to dom (which is odd) and works only with QxTextInput. For FireFox this results in not beeing able to use the TAB-key after setting the focus. You have to click first into the feld. Then the TAB-key handling works. In IE it works with TAB-keys.

Tho good solution would be to have this done by qooxdoo but I'm not deep enough into the sources to debug this.

Maybe Sebastian has some time to investigate on this (yes please!!!)

the problem is that the focus could only be done after the field is inside the document element. We need to thought about a good solution here first as this is not trivial.

Sebastian


Here is my workarround. It is implemented in a controller class which is associated to a QxParent. So maybe this should go direct to QxTextField.


proto._setCaretToEnd = function (control) {
 if (control.createTextRange) {
   var range = control.createTextRange();
   range.collapse(false);
   range.select();
 }
 else if (control.setSelectionRange) {
   control.focus();
   var length = control.value.length;
   control.setSelectionRange(length, length);
 }
};


proto._setCaretToStart = function(control) {
 if (control.createTextRange) {
   var range = control.createTextRange();
   range.collapse(true);
   range.select();
 }
 else if (control.setSelectionRange) {
   control.focus();
   control.setSelectionRange(0, 0);
 }
};


proto._setFocusToField = function(fld) {
 try {
   var el = fld.getElement();
   this._setCaretToEnd(el);
   fld.setFocused(true);
 }
 catch(err) {};
};


proto.setFocusToField = function(fld) {
 var _this = this;
 setTimeout(function() { _this._setFocusToField(fld); }, 10);
};




Oliver Vogel schrieb:

@dietrich
i thing, i remember that you had the problem of setting the focus of a qxTextField some days ago.

i haven't read the whole task. So please help me and answer:
1) is there a solution for this problem
2) if yes, how to do it

Thanks

Olli



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to