You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ha...@dds.nl on 2014/04/04 14:12:47 UTC

autocomplete + ajaxformcomponentupdate - mouseselection not working after error

Hi wicketusers,

I have an autocomplete textfield with an  
AjaxFormComponentUpdatingBehavior attached for the 'change' event.
After an error on the input the update is handled in the onError  
method --> ( some pseudocode )

autocompletefield.add(new AjaxFormComponentUpdatingBehavior("change") {

.....

             protected void onError(AjaxRequestTarget target,  
RuntimeException re) {
                autocompletefield.add(new  
AttributeModifier(CLASS_ATTRIBUTE, AUTOCOMPLETE_INVALID_CLASS));
                target.add(autocompletefield);
             }

Here is the autocompletefield replaced by an updated version with a  
new class attribute.

The problem is that a mouseselection of a listitem in the dropdown is  
not selected. A mouseselection just closes the autocomplete window.  
Selection with the keyboard works just fine.

Any suggestions how to tackle this problem?

Thanks in advance,

Haiko van der Schaaf



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


Re: autocomplete + ajaxformcomponentupdate - mouseselection not working after error

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Try to debug it.
Open wicket-autocomplete.js in the browser dev tools and see what happens.

Martin Grigorov
Wicket Training and Consulting


On Fri, Apr 4, 2014 at 2:12 PM, <ha...@dds.nl> wrote:

>
> Hi wicketusers,
>
> I have an autocomplete textfield with an AjaxFormComponentUpdatingBehavior
> attached for the 'change' event.
> After an error on the input the update is handled in the onError method
> --> ( some pseudocode )
>
> autocompletefield.add(new AjaxFormComponentUpdatingBehavior("change") {
>
> .....
>
>             protected void onError(AjaxRequestTarget target,
> RuntimeException re) {
>                autocompletefield.add(new AttributeModifier(CLASS_ATTRIBUTE,
> AUTOCOMPLETE_INVALID_CLASS));
>                target.add(autocompletefield);
>             }
>
> Here is the autocompletefield replaced by an updated version with a new
> class attribute.
>
> The problem is that a mouseselection of a listitem in the dropdown is not
> selected. A mouseselection just closes the autocomplete window. Selection
> with the keyboard works just fine.
>
> Any suggestions how to tackle this problem?
>
> Thanks in advance,
>
> Haiko van der Schaaf
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>