You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lucio Crusca <lu...@sulweb.org> on 2014/06/11 15:10:13 UTC

Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]

> Martin was right, there were Javascript errors, but for some reason the
> webconsole didn't display them the first time I looked at it.
>

However the problem is only partially solved. onUpdate() now gets called,
but only when the TextField looses focus. I need it to be called on every
single keypress... is there anything I should do for that?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]

Posted by Lucio Crusca <lu...@sulweb.org>.
> OnChangeAjaxBehavior is the right way.
> It uses either 'input' event when supported or 'cut'+'paste'+'keydown'
> when
> 'input' is not supported by the browser.
> Which browser do you use ?

Tested with IceWeasel 24.4.0, Chrome 33 for Linux and Firefox 27 for Windows.

>
> You can always use AjaxFormComponentUpdatingBehavior("keyup") but it will
> fire even when you use keys like ESC, F2, etc. You can filter those with
> AjaxCallListener's precondition.

But I haven't any forms. May I use AjaxFormComponentUpdatingBehavior
nevertheless?



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]

Posted by Martin Grigorov <mg...@apache.org>.
OnChangeAjaxBehavior is the right way.
It uses either 'input' event when supported or 'cut'+'paste'+'keydown' when
'input' is not supported by the browser.
Which browser do you use ?

You can always use AjaxFormComponentUpdatingBehavior("keyup") but it will
fire even when you use keys like ESC, F2, etc. You can filter those with
AjaxCallListener's precondition.

Martin Grigorov
Wicket Training and Consulting


On Thu, Jun 12, 2014 at 10:34 AM, Lucio Crusca <lu...@sulweb.org> wrote:

> > How about an AjaxBehavior with the onChange event?
>
> Assuming you mean AjaxEventBehavior (because I couldn't find any
> AjaxBehavior class), I tried with "change", "onChange" and "onchange"
> strings as event, but none of them seemed to work: the onEvent method was
> never called.
>
> >
> > On Jun 11, 2014, at 9:10 AM, Lucio Crusca <lu...@sulweb.org> wrote:
> >
> >>> Martin was right, there were Javascript errors, but for some reason the
> >>> webconsole didn't display them the first time I looked at it.
> >>>
> >>
> >> However the problem is only partially solved. onUpdate() now gets
> >> called,
> >> but only when the TextField looses focus. I need it to be called on
> >> every
> >> single keypress... is there anything I should do for that?
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]

Posted by Lucio Crusca <lu...@sulweb.org>.
> How about an AjaxBehavior with the onChange event?

Assuming you mean AjaxEventBehavior (because I couldn't find any
AjaxBehavior class), I tried with "change", "onChange" and "onchange"
strings as event, but none of them seemed to work: the onEvent method was
never called.

>
> On Jun 11, 2014, at 9:10 AM, Lucio Crusca <lu...@sulweb.org> wrote:
>
>>> Martin was right, there were Javascript errors, but for some reason the
>>> webconsole didn't display them the first time I looked at it.
>>>
>>
>> However the problem is only partially solved. onUpdate() now gets
>> called,
>> but only when the TextField looses focus. I need it to be called on
>> every
>> single keypress... is there anything I should do for that?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: OnChangeAjaxBehavior.onUpdate() not called [PARTIALLY SOLVED]

Posted by Paul Bors <pa...@bors.ws>.
How about an AjaxBehavior with the onChange event?

On Jun 11, 2014, at 9:10 AM, Lucio Crusca <lu...@sulweb.org> wrote:

>> Martin was right, there were Javascript errors, but for some reason the
>> webconsole didn't display them the first time I looked at it.
>> 
> 
> However the problem is only partially solved. onUpdate() now gets called,
> but only when the TextField looses focus. I need it to be called on every
> single keypress... is there anything I should do for that?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org