You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Andrew Berman <at...@gmail.com> on 2008/03/08 04:50:47 UTC
Javascript not evaluating with AbstractAutoCompleteBehavior
Hello,
If I have the following code:
textField.add(new AbstractAutoCompleteBehavior() {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
protected void onRequest(final String input,
RequestCycle requestCycle) {
}
@Override
protected void respond(AjaxRequestTarget target) {
target.appendJavascript("alert(\"hello\");");
}
});
When the page renders, the textfield is calling this event and I see the
response in the Wicket debug box, but the response is never being parsed and
the alert never shows up. Am I missing something here? I tested using an
AjaxEventBehavior with onkeypress and it works great. The only problem is
that I have no way of getting the text typed into the text field, which is
why I used the auto complete stuff. Any thoughts?
Thanks for your help!
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by Andrew Berman <at...@gmail.com>.
For the record, I was able to accomplish what I want a lot easier using
OnChangeAjaxBehavior.
On Sat, Mar 8, 2008 at 3:24 PM, Andrew Berman <at...@gmail.com> wrote:
> I'm doing a custom autocomplete and simply wanted to use
> AbstractAutoCompleteBehavior to at least pass me back the search term. I
> want to return a JavaScript call with the results which opens up a custom
> results panel. I'm not looking to pass back HTML with the results.
>
> I think Wicket should either change the behavior to use the same pipeline
> as Ajax event or make the respond method final and make sure that
> AjaxTargetRequest.get() returns null or an exception.
>
> On Sat, Mar 8, 2008 at 7:35 AM, Ryan Sonnek <ry...@gmail.com> wrote:
>
> > FYI:
> > you might want to check out the wicketstuff-scriptaculous auto
> > complete component instead.
> >
> >
> > http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior
> >
> >
> > On Sat, Mar 8, 2008 at 6:38 AM, i ii <kh...@hotmail.com> wrote:
> > >
> > > that does suck! why would wicket use a different "pipeline"??? that
> > is misleading!!!
> > >
> > > > Date: Sat, 8 Mar 2008 00:21:26 -0800
> > > > From: atberman@gmail.com
> > > > To: users@wicket.apache.org
> > > > Subject: Re: Javascript not evaluating with
> > AbstractAutoCompleteBehavior
> > >
> > >
> > > >
> > > > Oh, that sucks. That's VERY misleading because I can override
> > respond and I
> > > > have the AjaxRequestTarget or call AjaxRequestTarget.get() and get
> > a valid
> > > > object. Doesn't really make much sense that a different pipeline
> > would be
> > > > used. I guess I'll have to come up with a better solution using
> > > > WicketAjaxEvent.
> > > >
> > > > Thanks for your help!
> > > >
> > > > On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp <ma...@gmail.com>
> > wrote:
> > > >
> > > > > The autocomplete component doesn't use the wicket ajax pipeline
> > so
> > > > > that ajaxrequesttarget methods will not work for request invoked
> > by
> > > > > the autocomplete behavior.
> > > > >
> > > > > -Matej
> > > > >
> > > > > On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com>
> > wrote:
> > > > > > Hello,
> > > > > >
> > > > > > If I have the following code:
> > > > > >
> > > > > > textField.add(new AbstractAutoCompleteBehavior() {
> > > > > > /**
> > > > > > *
> > > > > > */
> > > > > > private static final long serialVersionUID = 1L;
> > > > > >
> > > > > > @Override
> > > > > > protected void onRequest(final String input,
> > > > > > RequestCycle requestCycle) {
> > > > > > }
> > > > > >
> > > > > > @Override
> > > > > > protected void respond(AjaxRequestTarget target) {
> > > > > > target.appendJavascript("alert(\"hello\");");
> > > > > > }
> > > > > > });
> > > > > >
> > > > > > When the page renders, the textfield is calling this event and
> > I see
> > > > > the
> > > > > > response in the Wicket debug box, but the response is never
> > being
> > > > > parsed and
> > > > > > the alert never shows up. Am I missing something here? I
> > tested
> > > > > using an
> > > > > > AjaxEventBehavior with onkeypress and it works great. The
> > only problem
> > > > > is
> > > > > > that I have no way of getting the text typed into the text
> > field, which
> > > > > is
> > > > > > why I used the auto complete stuff. Any thoughts?
> > > > > >
> > > > > > Thanks for your help!
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Resizable and reorderable grid components.
> > > > > http://www.inmethod.com
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > 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: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by Andrew Berman <at...@gmail.com>.
I'm doing a custom autocomplete and simply wanted to use
AbstractAutoCompleteBehavior to at least pass me back the search term. I
want to return a JavaScript call with the results which opens up a custom
results panel. I'm not looking to pass back HTML with the results.
I think Wicket should either change the behavior to use the same pipeline as
Ajax event or make the respond method final and make sure that
AjaxTargetRequest.get() returns null or an exception.
On Sat, Mar 8, 2008 at 7:35 AM, Ryan Sonnek <ry...@gmail.com> wrote:
> FYI:
> you might want to check out the wicketstuff-scriptaculous auto
> complete component instead.
>
>
> http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior
>
>
> On Sat, Mar 8, 2008 at 6:38 AM, i ii <kh...@hotmail.com> wrote:
> >
> > that does suck! why would wicket use a different "pipeline"??? that is
> misleading!!!
> >
> > > Date: Sat, 8 Mar 2008 00:21:26 -0800
> > > From: atberman@gmail.com
> > > To: users@wicket.apache.org
> > > Subject: Re: Javascript not evaluating with
> AbstractAutoCompleteBehavior
> >
> >
> > >
> > > Oh, that sucks. That's VERY misleading because I can override
> respond and I
> > > have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a
> valid
> > > object. Doesn't really make much sense that a different pipeline
> would be
> > > used. I guess I'll have to come up with a better solution using
> > > WicketAjaxEvent.
> > >
> > > Thanks for your help!
> > >
> > > On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp <ma...@gmail.com>
> wrote:
> > >
> > > > The autocomplete component doesn't use the wicket ajax pipeline so
> > > > that ajaxrequesttarget methods will not work for request invoked by
> > > > the autocomplete behavior.
> > > >
> > > > -Matej
> > > >
> > > > On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com>
> wrote:
> > > > > Hello,
> > > > >
> > > > > If I have the following code:
> > > > >
> > > > > textField.add(new AbstractAutoCompleteBehavior() {
> > > > > /**
> > > > > *
> > > > > */
> > > > > private static final long serialVersionUID = 1L;
> > > > >
> > > > > @Override
> > > > > protected void onRequest(final String input,
> > > > > RequestCycle requestCycle) {
> > > > > }
> > > > >
> > > > > @Override
> > > > > protected void respond(AjaxRequestTarget target) {
> > > > > target.appendJavascript("alert(\"hello\");");
> > > > > }
> > > > > });
> > > > >
> > > > > When the page renders, the textfield is calling this event and I
> see
> > > > the
> > > > > response in the Wicket debug box, but the response is never
> being
> > > > parsed and
> > > > > the alert never shows up. Am I missing something here? I
> tested
> > > > using an
> > > > > AjaxEventBehavior with onkeypress and it works great. The only
> problem
> > > > is
> > > > > that I have no way of getting the text typed into the text
> field, which
> > > > is
> > > > > why I used the auto complete stuff. Any thoughts?
> > > > >
> > > > > Thanks for your help!
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Resizable and reorderable grid components.
> > > > http://www.inmethod.com
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > 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: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by Ryan Sonnek <ry...@gmail.com>.
FYI:
you might want to check out the wicketstuff-scriptaculous auto
complete component instead.
http://wicketstuff.org/confluence/display/STUFFWIKI/Script.aculo.us+AutoCompleteBehavior
On Sat, Mar 8, 2008 at 6:38 AM, i ii <kh...@hotmail.com> wrote:
>
> that does suck! why would wicket use a different "pipeline"??? that is misleading!!!
>
> > Date: Sat, 8 Mar 2008 00:21:26 -0800
> > From: atberman@gmail.com
> > To: users@wicket.apache.org
> > Subject: Re: Javascript not evaluating with AbstractAutoCompleteBehavior
>
>
> >
> > Oh, that sucks. That's VERY misleading because I can override respond and I
> > have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid
> > object. Doesn't really make much sense that a different pipeline would be
> > used. I guess I'll have to come up with a better solution using
> > WicketAjaxEvent.
> >
> > Thanks for your help!
> >
> > On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp <ma...@gmail.com> wrote:
> >
> > > The autocomplete component doesn't use the wicket ajax pipeline so
> > > that ajaxrequesttarget methods will not work for request invoked by
> > > the autocomplete behavior.
> > >
> > > -Matej
> > >
> > > On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com> wrote:
> > > > Hello,
> > > >
> > > > If I have the following code:
> > > >
> > > > textField.add(new AbstractAutoCompleteBehavior() {
> > > > /**
> > > > *
> > > > */
> > > > private static final long serialVersionUID = 1L;
> > > >
> > > > @Override
> > > > protected void onRequest(final String input,
> > > > RequestCycle requestCycle) {
> > > > }
> > > >
> > > > @Override
> > > > protected void respond(AjaxRequestTarget target) {
> > > > target.appendJavascript("alert(\"hello\");");
> > > > }
> > > > });
> > > >
> > > > When the page renders, the textfield is calling this event and I see
> > > the
> > > > response in the Wicket debug box, but the response is never being
> > > parsed and
> > > > the alert never shows up. Am I missing something here? I tested
> > > using an
> > > > AjaxEventBehavior with onkeypress and it works great. The only problem
> > > is
> > > > that I have no way of getting the text typed into the text field, which
> > > is
> > > > why I used the auto complete stuff. Any thoughts?
> > > >
> > > > Thanks for your help!
> > > >
> > >
> > >
> > >
> > > --
> > > Resizable and reorderable grid components.
> > > http://www.inmethod.com
> > >
> > > ---------------------------------------------------------------------
> > > 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: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by i ii <kh...@hotmail.com>.
that does suck! why would wicket use a different "pipeline"??? that is misleading!!!
> Date: Sat, 8 Mar 2008 00:21:26 -0800
> From: atberman@gmail.com
> To: users@wicket.apache.org
> Subject: Re: Javascript not evaluating with AbstractAutoCompleteBehavior
>
> Oh, that sucks. That's VERY misleading because I can override respond and I
> have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid
> object. Doesn't really make much sense that a different pipeline would be
> used. I guess I'll have to come up with a better solution using
> WicketAjaxEvent.
>
> Thanks for your help!
>
> On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp <ma...@gmail.com> wrote:
>
> > The autocomplete component doesn't use the wicket ajax pipeline so
> > that ajaxrequesttarget methods will not work for request invoked by
> > the autocomplete behavior.
> >
> > -Matej
> >
> > On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com> wrote:
> > > Hello,
> > >
> > > If I have the following code:
> > >
> > > textField.add(new AbstractAutoCompleteBehavior() {
> > > /**
> > > *
> > > */
> > > private static final long serialVersionUID = 1L;
> > >
> > > @Override
> > > protected void onRequest(final String input,
> > > RequestCycle requestCycle) {
> > > }
> > >
> > > @Override
> > > protected void respond(AjaxRequestTarget target) {
> > > target.appendJavascript("alert(\"hello\");");
> > > }
> > > });
> > >
> > > When the page renders, the textfield is calling this event and I see
> > the
> > > response in the Wicket debug box, but the response is never being
> > parsed and
> > > the alert never shows up. Am I missing something here? I tested
> > using an
> > > AjaxEventBehavior with onkeypress and it works great. The only problem
> > is
> > > that I have no way of getting the text typed into the text field, which
> > is
> > > why I used the auto complete stuff. Any thoughts?
> > >
> > > Thanks for your help!
> > >
> >
> >
> >
> > --
> > Resizable and reorderable grid components.
> > http://www.inmethod.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by Andrew Berman <at...@gmail.com>.
Oh, that sucks. That's VERY misleading because I can override respond and I
have the AjaxRequestTarget or call AjaxRequestTarget.get() and get a valid
object. Doesn't really make much sense that a different pipeline would be
used. I guess I'll have to come up with a better solution using
WicketAjaxEvent.
Thanks for your help!
On Fri, Mar 7, 2008 at 10:57 PM, Matej Knopp <ma...@gmail.com> wrote:
> The autocomplete component doesn't use the wicket ajax pipeline so
> that ajaxrequesttarget methods will not work for request invoked by
> the autocomplete behavior.
>
> -Matej
>
> On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com> wrote:
> > Hello,
> >
> > If I have the following code:
> >
> > textField.add(new AbstractAutoCompleteBehavior() {
> > /**
> > *
> > */
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected void onRequest(final String input,
> > RequestCycle requestCycle) {
> > }
> >
> > @Override
> > protected void respond(AjaxRequestTarget target) {
> > target.appendJavascript("alert(\"hello\");");
> > }
> > });
> >
> > When the page renders, the textfield is calling this event and I see
> the
> > response in the Wicket debug box, but the response is never being
> parsed and
> > the alert never shows up. Am I missing something here? I tested
> using an
> > AjaxEventBehavior with onkeypress and it works great. The only problem
> is
> > that I have no way of getting the text typed into the text field, which
> is
> > why I used the auto complete stuff. Any thoughts?
> >
> > Thanks for your help!
> >
>
>
>
> --
> Resizable and reorderable grid components.
> http://www.inmethod.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Javascript not evaluating with AbstractAutoCompleteBehavior
Posted by Matej Knopp <ma...@gmail.com>.
The autocomplete component doesn't use the wicket ajax pipeline so
that ajaxrequesttarget methods will not work for request invoked by
the autocomplete behavior.
-Matej
On Sat, Mar 8, 2008 at 4:50 AM, Andrew Berman <at...@gmail.com> wrote:
> Hello,
>
> If I have the following code:
>
> textField.add(new AbstractAutoCompleteBehavior() {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> @Override
> protected void onRequest(final String input,
> RequestCycle requestCycle) {
> }
>
> @Override
> protected void respond(AjaxRequestTarget target) {
> target.appendJavascript("alert(\"hello\");");
> }
> });
>
> When the page renders, the textfield is calling this event and I see the
> response in the Wicket debug box, but the response is never being parsed and
> the alert never shows up. Am I missing something here? I tested using an
> AjaxEventBehavior with onkeypress and it works great. The only problem is
> that I have no way of getting the text typed into the text field, which is
> why I used the auto complete stuff. Any thoughts?
>
> Thanks for your help!
>
--
Resizable and reorderable grid components.
http://www.inmethod.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org