Completely agree with you thanks.

But i'll do that only if i'll have more than one textField to manage like
this in my app. At the moment, it's not the case.

I've added a "TODO" special Loren in my code in case of hehehe






2013/5/23 Loren Schlomer <[email protected]>

> I would extend qx.ui.form.TextField, add a custom event, and then wire up
> event handlers for both 'blur' and 'keypress' when both then fire your
> custom event when conditions are met.
>
> Then in code usage, just wire up your custom event to your real handler...
>
>
>
>
>
>
> On Thu, May 23, 2013 at 12:35 PM, franck34 <[email protected]> wrote:
>
>> Finaly, i've failed using qx.eventRegistration, but i succeed using
>> something like this :
>>
>> var onInputEvent = function(ev) {
>>   if (ev.getType() == 'blur' || ev.getKeyIdentifier() == 'Enter') {
>>     doSomething();
>>   }
>> }
>>
>> textField.addListener('keypress', onInputEvent);
>> textField.addListener('blur',onInputEvent);
>>
>>
>>
>>
>> 2013/5/23 franck34 <[email protected]>
>>
>>>
>>> Got error
>>> No dispatcher can handle event of type keypress on qx.ui.form.TextField
>>>
>>> Thanks Derrell, i know where to go deeper ;)
>>>
>>>
>>> 2013/5/23 Derrell Lipman <[email protected]>
>>>
>>>> On Thu, May 23, 2013 at 2:25 PM, franck34 <[email protected]> wrote:
>>>>
>>>>>
>>>>> Hi the list.
>>>>>
>>>>> A day without mail ? not possible :)
>>>>>
>>>>> i've got
>>>>>
>>>>> textField.addListener('keypress',function(ev) {
>>>>>   if (ev.getKeyIdentifier() == 'Enter') {
>>>>>     doSomething();
>>>>> });
>>>>>
>>>>>
>>>>> and i'd like to add something like
>>>>>
>>>>> textField.addListener('blur',function(ev) {
>>>>>     // blur event, let's do the same thing as the user type 'Enter' key
>>>>>     textField.fireEvent('keypress',qx.event.type.KeySequence, args);
>>>>> // HERE IS ARGS
>>>>> });
>>>>>
>>>>
>>>> You can probably do something like this, which I haven't tested and
>>>> likely doesn't work quite correctly, but should at least point you in the
>>>> right direction:
>>>>
>>>> textField.addListener('blur', function(ev) {
>>>>   var Registration = qx.event.Registration;
>>>>   var e = Registration.createEvent('keypress',
>>>> qx.event.type.KeySequence, [ { keyCode : 13 }, textField, 'Enter' ]);
>>>>   Registration.dispatchEvent(textField, e);
>>>> }
>>>>
>>>> Derrell
>>>>
>>>>
>>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Try New Relic Now & We'll Send You this Cool Shirt
>> New Relic is the only SaaS-based application performance monitoring
>> service
>> that delivers powerful full stack analytics. Optimize and monitor your
>> browser, app, & servers with just a few lines of code. Try New Relic
>> and get this awesome Nerd Life shirt!
>> http://p.sf.net/sfu/newrelic_d2d_may
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to