You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Hao <mi...@gmail.com> on 2013/05/29 02:50:38 UTC

Struts 2 jQuery autocompleter and dynamic list

I am trying to implement an auto complete feature using Struts 2 jQuery
plugin - <sj:autocompleter>. The suggestion list need to be dynamically
retrieved from backend based on the characters user entered. Is it possible
to implement this behaviour using S2 jQuery plugin? Does anyone has a good
example?

I could not find such an example in showcase.

Thanks,
Mike

Re: Struts 2 jQuery autocompleter and dynamic list

Posted by Mike Hao <mi...@gmail.com>.
Hi Antonios and Dave,

Thanks again for your responses. I actually downloaded the whole showcase
project, and trying debugging on my local machine, trying to figure out
what's the trick of it. At here, I think if the wiki pages provides more
detail instructions on how to set some critical attributes, that would be a
great help to users. I think I am not only one get confused. Like the
variable "term" declared in the Autocompleter.java class. Nowhere tells
users what's this guy, how to use it. Now, I finally figured out that this
"term" is used to catch the characters user typed in.

I actually tried this several months ago, and could not get it working. So,
I gave it up. Now, I came back again, since I have to.

Regards,
Mike



On Wed, May 29, 2013 at 2:39 PM, Dave Newton <da...@gmail.com> wrote:

> I'd just try it; seems like `list` would be for immediate data (e.g., on
> first page load) and then it would be replaced by data from
> `href`--although I'm not sure what the point of using both would be.
>
> Dave
>
>
> On Wed, May 29, 2013 at 2:25 PM, Antonios Gkogkakis <gk...@tcd.ie>
> wrote:
>
> > I haven't used the sj:autocompleter (I'm using the jQuery
> > autocompletedirectly), but from what I'm reading in the documentation
> > if you use the href that points to a location that is returning json data
> > you don't have to use the list attribute.
> >
> > Have you tried setting up the  example in the documentation?
> >
> >
> >
> >
> >
> > On 29 May 2013 18:57, Mike Hao <mi...@gmail.com> wrote:
> >
> > > Hi Antonios,
> > >
> > > Thank you so much for your response. I was actually keep reading the
> wiki
> > > these days, but I am still not able to get what I expected.
> > >
> > >
> > > For <sj:autocompleter>, can these two attribute "list" and "href" used
> > > together?
> > >
> > > Thanks,
> > > Mike
> > >
> > >
> > > On Wed, May 29, 2013 at 4:13 AM, Antonios Gkogkakis <gk...@tcd.ie>
> > > wrote:
> > >
> > > > Hi Mike,
> > > >
> > > > have a look at the following link
> > > > https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag
> > > >
> > > > Antonios
> > > >
> > > >
> > > >
> > > > On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:
> > > >
> > > > > I am trying to implement an auto complete feature using Struts 2
> > jQuery
> > > > > plugin - <sj:autocompleter>. The suggestion list need to be
> > dynamically
> > > > > retrieved from backend based on the characters user entered. Is it
> > > > possible
> > > > > to implement this behaviour using S2 jQuery plugin? Does anyone
> has a
> > > > good
> > > > > example?
> > > > >
> > > > > I could not find such an example in showcase.
> > > > >
> > > > > Thanks,
> > > > > Mike
> > > > >
> > > >
> > >
> >
>
>
>
> --
> e: davelnewton@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>

Re: Struts 2 jQuery autocompleter and dynamic list

Posted by Dave Newton <da...@gmail.com>.
I'd just try it; seems like `list` would be for immediate data (e.g., on
first page load) and then it would be replaced by data from
`href`--although I'm not sure what the point of using both would be.

Dave


On Wed, May 29, 2013 at 2:25 PM, Antonios Gkogkakis <gk...@tcd.ie> wrote:

> I haven't used the sj:autocompleter (I'm using the jQuery
> autocompletedirectly), but from what I'm reading in the documentation
> if you use the href that points to a location that is returning json data
> you don't have to use the list attribute.
>
> Have you tried setting up the  example in the documentation?
>
>
>
>
>
> On 29 May 2013 18:57, Mike Hao <mi...@gmail.com> wrote:
>
> > Hi Antonios,
> >
> > Thank you so much for your response. I was actually keep reading the wiki
> > these days, but I am still not able to get what I expected.
> >
> >
> > For <sj:autocompleter>, can these two attribute "list" and "href" used
> > together?
> >
> > Thanks,
> > Mike
> >
> >
> > On Wed, May 29, 2013 at 4:13 AM, Antonios Gkogkakis <gk...@tcd.ie>
> > wrote:
> >
> > > Hi Mike,
> > >
> > > have a look at the following link
> > > https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag
> > >
> > > Antonios
> > >
> > >
> > >
> > > On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:
> > >
> > > > I am trying to implement an auto complete feature using Struts 2
> jQuery
> > > > plugin - <sj:autocompleter>. The suggestion list need to be
> dynamically
> > > > retrieved from backend based on the characters user entered. Is it
> > > possible
> > > > to implement this behaviour using S2 jQuery plugin? Does anyone has a
> > > good
> > > > example?
> > > >
> > > > I could not find such an example in showcase.
> > > >
> > > > Thanks,
> > > > Mike
> > > >
> > >
> >
>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Re: Struts 2 jQuery autocompleter and dynamic list

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
I haven't used the sj:autocompleter (I'm using the jQuery
autocompletedirectly), but from what I'm reading in the documentation
if you use the href that points to a location that is returning json data
you don't have to use the list attribute.

Have you tried setting up the  example in the documentation?





On 29 May 2013 18:57, Mike Hao <mi...@gmail.com> wrote:

> Hi Antonios,
>
> Thank you so much for your response. I was actually keep reading the wiki
> these days, but I am still not able to get what I expected.
>
>
> For <sj:autocompleter>, can these two attribute "list" and "href" used
> together?
>
> Thanks,
> Mike
>
>
> On Wed, May 29, 2013 at 4:13 AM, Antonios Gkogkakis <gk...@tcd.ie>
> wrote:
>
> > Hi Mike,
> >
> > have a look at the following link
> > https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag
> >
> > Antonios
> >
> >
> >
> > On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:
> >
> > > I am trying to implement an auto complete feature using Struts 2 jQuery
> > > plugin - <sj:autocompleter>. The suggestion list need to be dynamically
> > > retrieved from backend based on the characters user entered. Is it
> > possible
> > > to implement this behaviour using S2 jQuery plugin? Does anyone has a
> > good
> > > example?
> > >
> > > I could not find such an example in showcase.
> > >
> > > Thanks,
> > > Mike
> > >
> >
>

Re: Struts 2 jQuery autocompleter and dynamic list

Posted by Mike Hao <mi...@gmail.com>.
Hi Antonios,

Thank you so much for your response. I was actually keep reading the wiki
these days, but I am still not able to get what I expected.


For <sj:autocompleter>, can these two attribute "list" and "href" used
together?

Thanks,
Mike


On Wed, May 29, 2013 at 4:13 AM, Antonios Gkogkakis <gk...@tcd.ie> wrote:

> Hi Mike,
>
> have a look at the following link
> https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag
>
> Antonios
>
>
>
> On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:
>
> > I am trying to implement an auto complete feature using Struts 2 jQuery
> > plugin - <sj:autocompleter>. The suggestion list need to be dynamically
> > retrieved from backend based on the characters user entered. Is it
> possible
> > to implement this behaviour using S2 jQuery plugin? Does anyone has a
> good
> > example?
> >
> > I could not find such an example in showcase.
> >
> > Thanks,
> > Mike
> >
>

RE: Struts 2 jQuery autocompleter and dynamic list

Posted by Martin Gainty <mg...@hotmail.com>.
my fellow irishman is of course DOB right

one more thing
be sure to set selectbox="true"

Saludos Cordiales,
Martin Gainty 
______________________________________________ 
Porfavor..no altere ni interrumpir esta communicacion..Gracias
   

 
> Date: Wed, 29 May 2013 09:13:00 +0100
> Subject: Re: Struts 2 jQuery autocompleter and dynamic list
> From: gkogkaka@tcd.ie
> To: user@struts.apache.org
> 
> Hi Mike,
> 
> have a look at the following link
> https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag
> 
> Antonios
> 
> 
> 
> On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:
> 
> > I am trying to implement an auto complete feature using Struts 2 jQuery
> > plugin - <sj:autocompleter>. The suggestion list need to be dynamically
> > retrieved from backend based on the characters user entered. Is it possible
> > to implement this behaviour using S2 jQuery plugin? Does anyone has a good
> > example?
> >
> > I could not find such an example in showcase.
> >
> > Thanks,
> > Mike
> >
 		 	   		  

Re: Struts 2 jQuery autocompleter and dynamic list

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
Hi Mike,

have a look at the following link
https://code.google.com/p/struts2-jquery/wiki/AutocompleterTag

Antonios



On 29 May 2013 01:50, Mike Hao <mi...@gmail.com> wrote:

> I am trying to implement an auto complete feature using Struts 2 jQuery
> plugin - <sj:autocompleter>. The suggestion list need to be dynamically
> retrieved from backend based on the characters user entered. Is it possible
> to implement this behaviour using S2 jQuery plugin? Does anyone has a good
> example?
>
> I could not find such an example in showcase.
>
> Thanks,
> Mike
>