Hello Thomas,
now it's getting interesting. It could really be a problem that you create
the windows on runtime. Could you add a "appear" listener to the window
containing the form and execute the flush and focus in there? Maybe thats
the spot where we should trigger the selection.
Best,
Martin
Thomas Dräger wrote:
>
> Hello Martin,
>
> your solution works (in playground), but unfortunately not in my app.
>
> i have an inline application which creates and opens a class that is
> extended from a window.
> i have some forms, classes extending composite. these forms are created
> and opened inside the window at runtime. like steps of a wizard. i have
> put your solution at the end of the constructor of the form (composite)
> where the datefield is created. nothing happens.
>
> i think its because the forms are created at runtime.
>
> my app:
>
> Application.Inline
> - window.open()
> - form1 (composite)
> - form2 (composite, replaces form1)
> - form3 ...
>
> regards
>
> Thomas
>
>
> MartinWittemann wrote:
>>
>> Hello Thomas,
>>
>> I guess it would be the best solution for the user, if the default value
>> is selected so he can override it on input. Take a look at the following
>> code. It demonstrates the way you can select the text in the textfield of
>> the datefield.
>>
>> var datefield = new qx.ui.form.DateField();
>> datefield.setValue(new Date());
>> this.getRoot().add(datefield);
>>
>> datefield.focus();
>> qx.ui.core.queue.Manager.flush();
>> datefield.getChildControl("textfield").selectAll();
>>
>> As you can see, you currently need to flush the queues to create the
>> element to ensure that the selection is working. Thats something we
>> consider a bug and opened up a report for it:
>> http://bugzilla.qooxdoo.org/show_bug.cgi?id=2727
>> But as long as you do the flush manually, this code should work fine.
>>
>> If you just like to move the cursor to the front you can use the
>> following line instead of the last line:
>> datefield.getChildControl("textfield").setSelection(0,0);
>>
>> Regards,
>> Martin
>>
>>
>> Thomas Dräger wrote:
>>>
>>> Hello,
>>>
>>> i have a form with some input elements. im trying to set the focus on a
>>> datefield after loading of the form so that the user does not have to
>>> click in the widget. the datefield's default value is '00.00.0000'.
>>>
>>> when i use element.focus() the widget is higlighted but dont accepts
>>> keyboard input.
>>> i have tried element.tabFocus(), the widget get the blinking cursor for
>>> input but the cursor is at the end of the value so any input is
>>> appended.
>>>
>>> is there a method to set the focus on the datefield that it accepts
>>> keyboard input without the need of a click inside and the value in the
>>> datefield gets overridden.
>>>
>>> thanks
>>> Thomas
>>>
>>
>>
>
>
--
View this message in context:
http://n2.nabble.com/focus-on-datefield-tp3522209p3533189.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel