You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Piotr Jakubowski <pi...@gmail.com> on 2008/12/27 19:35:12 UTC

Problem with inline javascript

Hi!
Is there any way to make Wicket use unobtrusive way to attach ajax behaviors
to html elements instead of putting them inline into html?

I have a problem as I have a TextField to input search pattern and then I
use Ajax to show popUp with search results. The thing is the search results
always updates the search results list when the key is being pressed in the
TextField. I wanted to add the keyboard navigation, and therefore disable
the update behavior while the keys that are pressed are Arrows or Enter.
Unfortunately when the Ajax Update thing is inline in html as onkeyup
attribute - the only way to do that in jQuery is to remove this attribute.
Unbind and stuff does not work.

I hope that you understand what I want to do :) Maybe you have some
suggestions on how to do that.

Thanks in advance ;)
-- 
View this message in context: http://www.nabble.com/Problem-with-inline-javascript-tp21186429p21186429.html
Sent from the Wicket - User 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: Problem with inline javascript

Posted by Jeremy Thomerson <je...@wickettraining.com>.
How are you doing the auto-complete?  AutoCompleteTextField uses the
following code, which renders in the head of the page - not inline.  You
could / should use it in your own behaviors as well.

response.renderOnDomReadyJavascript("your js");

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Sat, Dec 27, 2008 at 12:35 PM, Piotr Jakubowski <pi...@gmail.com> wrote:

>
> Hi!
> Is there any way to make Wicket use unobtrusive way to attach ajax
> behaviors
> to html elements instead of putting them inline into html?
>
> I have a problem as I have a TextField to input search pattern and then I
> use Ajax to show popUp with search results. The thing is the search results
> always updates the search results list when the key is being pressed in the
> TextField. I wanted to add the keyboard navigation, and therefore disable
> the update behavior while the keys that are pressed are Arrows or Enter.
> Unfortunately when the Ajax Update thing is inline in html as onkeyup
> attribute - the only way to do that in jQuery is to remove this attribute.
> Unbind and stuff does not work.
>
> I hope that you understand what I want to do :) Maybe you have some
> suggestions on how to do that.
>
> Thanks in advance ;)
> --
> View this message in context:
> http://www.nabble.com/Problem-with-inline-javascript-tp21186429p21186429.html
> Sent from the Wicket - User 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
>
>