You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marc Nuri San Félix <ma...@marcnuri.com> on 2012/12/13 19:13:32 UTC

Can't get AutocompleteBehavior to work

Hello

I'm migrating my applications to wicket 6.0.3 form the latest Wicket 1.5.

I've got some problems with wicket AutocompleteBehavior. There are no
javascript exceptions in the browser console, but some functionality is not
working.
The problems are regarding showing the list of choices when keys are
pressed in the TextField.  The list is only shown when TextField gains
focus or when 'KEYDOWN' is pressed.

The following function is never triggered from the browser when text is
input:
[code]
Wicket.Event.add(obj, 'inputchange', function (jqEvent) {
var kc = Wicket.Event.keyCode(jqEvent);
switch(kc) {
case KEY_TAB:
case KEY_ENTER:
return jqEvent.stopPropagation();
case KEY_UP:
case KEY_DOWN:
case KEY_ESC:
case KEY_RIGHT:
case KEY_LEFT:
case KEY_SHIFT:
case KEY_ALT:
case KEY_CTRL:
break;
default:
updateChoices();
}
if(typeof objonkeyup === "function") {
return objonkeyup.apply(this,[jqEvent]);
}
});
[/code]

Both "onkeydown"  and "onkeypress" are working, thus the list is only shown
when the down arrow key is pressed in the TextField.


Is anyone else having the same problem? Might be browser related
(Chrome 23.0.1271.95
m)? or is it a bug?

--
Marc Nuri
http://www.marcnuri.com

Re: Can't get AutocompleteBehavior to work

Posted by Martin Grigorov <mg...@apache.org>.
Thanks for sharing!


On Fri, Dec 14, 2012 at 11:20 AM, Marc Nuri San Félix <ma...@marcnuri.com>wrote:

> Hello
> I finally managed to solve the problem.
> My Page was loading another version of JQuery (1.8.3) along with Wicket's
> own JQuery version (1.8.2), this didn't allow Wicket's custom event
> "inputchange" to bind correctly to the TextField.
> Simply changing my custom JQuery Behaviors to use Wicket's JQuery version
> as a a dependency  solved the problem.
> Cheers
> --
> Marc Nuri
> www.marcnuri.com
>
>
> On Thu, Dec 13, 2012 at 7:16 PM, Marc Nuri <ma...@marcnuri.com> wrote:
>
> > I meant Wicket 6.3, not 6.0.3
> >
> >
> >
> > -----
> > --
> > Marc Nuri
> > www.marcnuri.com
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/Can-t-get-AutocompleteBehavior-to-work-tp4654780p4654781.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Can't get AutocompleteBehavior to work

Posted by Marc Nuri San Félix <ma...@marcnuri.com>.
Hello
I finally managed to solve the problem.
My Page was loading another version of JQuery (1.8.3) along with Wicket's
own JQuery version (1.8.2), this didn't allow Wicket's custom event
"inputchange" to bind correctly to the TextField.
Simply changing my custom JQuery Behaviors to use Wicket's JQuery version
as a a dependency  solved the problem.
Cheers
--
Marc Nuri
www.marcnuri.com


On Thu, Dec 13, 2012 at 7:16 PM, Marc Nuri <ma...@marcnuri.com> wrote:

> I meant Wicket 6.3, not 6.0.3
>
>
>
> -----
> --
> Marc Nuri
> www.marcnuri.com
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Can-t-get-AutocompleteBehavior-to-work-tp4654780p4654781.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Can't get AutocompleteBehavior to work

Posted by Marc Nuri <ma...@marcnuri.com>.
I meant Wicket 6.3, not 6.0.3



-----
--
Marc Nuri
www.marcnuri.com 
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-t-get-AutocompleteBehavior-to-work-tp4654780p4654781.html
Sent from the Users forum mailing list archive at Nabble.com.

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