You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "jfrm.maurel@gmail.com" <jf...@gmail.com> on 2018/08/19 09:05:07 UTC

[Tobago] f:ajax inside tc:in event="keyup"

Hi,

I would like to check whether a user entry is a valid e-mail address 
each time a key is pressed.

When I use f:ajax with event="keyup" inside tc:in, Tobago complains that 
this event is not valid. It seems like this event is not implemented.

   <tc:in id="username" value="#{loginController.username}" label="User" 
focus="true">
    <f:ajax event="keyup" listener="#{loginController.checkMel}" />
   </tc:in>


Is there a workaround for this ?

Regards.

-- 
Jean-François MAUREL
PIMECA
http://www.pimeca.com


Re: [Tobago] f:ajax inside tc:in event="keyup"

Posted by Henning Nöth <he...@irian.eu>.
Hi,

Tobago doesn't currently support the 'keyup' event.
We plan to implement this in the future but in the meantime you have to
use the 'change' event.

If 'change' is absolutely not an option, the only workaround I see is a
JavaScript-Hack.
You can put a listener on 'keyup' and trigger the 'change' event.
Something like this:

function() {
  var $inputAjaxField = jQuery("#page\\:mainForm\\:inputAjax\\:\\:field");
  $inputAjaxField.on('keyup', function () {
    $inputAjaxField.trigger('change');
  });
};

But I'm not sure what side effects will occur...


Regards,
Henning


Am 21.08.18 um 09:26 schrieb Volker Weber:
> Hi Dennis,
> 
> Am Mo., 20. Aug. 2018 um 18:50 Uhr schrieb Dennis Kieselhorst <
> deki@apache.org>:
> 
>>
>> I see, I'm not sure if this is really the intended behaviour.
>>
>> @Udo, Henning what do you think?
>>
>> Cheers
>> Dennis
>>
> 
> I'm not sure about your question, is it about the behavior of the
> "onchange" event? I think this works like intended. It makes no sense to
> fire this event at a text input on every keypress, even if each keypress
> changes the content.
> 
> Regards,
>   Volker
> 
> 
> 

Re: [Tobago] f:ajax inside tc:in event="keyup"

Posted by Volker Weber <v....@inexso.de>.
Hi Dennis,

Am Mo., 20. Aug. 2018 um 18:50 Uhr schrieb Dennis Kieselhorst <
deki@apache.org>:

>
> I see, I'm not sure if this is really the intended behaviour.
>
> @Udo, Henning what do you think?
>
> Cheers
> Dennis
>

I'm not sure about your question, is it about the behavior of the
"onchange" event? I think this works like intended. It makes no sense to
fire this event at a text input on every keypress, even if each keypress
changes the content.

Regards,
  Volker



-- 
inexso - information exchange solutions GmbH
Ofener Straße 30 | 26121 Oldenburg
www.inexso.de

Re: [Tobago] f:ajax inside tc:in event="keyup"

Posted by Dennis Kieselhorst <de...@apache.org>.
Am 20.08.2018 um 18:43 schrieb jfrm.maurel@gmail.com:
> 
> Hi,
> 
> Le 19/08/2018 à 21:58, Dennis Kieselhorst a écrit :
>> the change event should work for your usecase.
> 
> Thank you for your answer. If I understand well the event will be fired
> only when the component looses focus with change. I would like to send
> it before if possible to capture the user error as soon as possible.
> 
> Regards.
> 

I see, I'm not sure if this is really the intended behaviour.

@Udo, Henning what do you think?

Cheers
Dennis

Re: [Tobago] f:ajax inside tc:in event="keyup"

Posted by Dennis Kieselhorst <de...@apache.org>.
Hi,

the change event should work for your usecase. You'll find a sample at
the bottom of the page:
http://tobago-vm.apache.org/demo-4-release/content/20-component/010-input/10-in/in.xhtml

Regards
Dennis