In the jsp i have this <script type="text/javascript" src="../lib/prototype/prototype.js"></script> <script type="text/javascript" src="../lib/scriptaculous/scriptaculous.js"></script> <script type="text/javascript" src="../src/autocomplete.js"></script> <s:form name="userForm" action="saveUser" method="post" validate="true"> <div id="autocomplete_choices" class="autocomplete"></div> <s:textfield id="autocomplete" key="user.firstName" />
</s:form> <script type="text/javascript"> new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "auto.html", { paramName: "value", minChars: 2, indicator: 'indicator1' }); </script> In the struts.xml I have this <action name="auto" class="org.appfuse.web.Autocomplete" method="doWork"> <result name="success">auto.jsp</result> </action> On Fri, May 1, 2009 at 10:22 PM, Matt Raible <m...@raibledesigns.com> wrote: > What's the code you're using? > > > On Fri, May 1, 2009 at 9:53 AM, Saeed Iqbal <saee...@gmail.com> wrote: > >> Hi >> >> The URL only gets called once at the begining when I load the page. It >> doesnt get called when something is typed. >> >> Thanks, >> -saeed >> >> >> On Fri, May 1, 2009 at 9:24 PM, Saeed Iqbal <saee...@gmail.com> wrote: >> >>> Hi >>> >>> I was doing a mistake. I had autocomplete="off" with the textfield tag. >>> >>> Now the problem is not everytime when I type, the method gets called. Can >>> you recommend another script to use please. >>> >>> Thanks, >>> -saeed >>> >>> >>> On Fri, May 1, 2009 at 9:07 PM, Saeed Iqbal <saee...@gmail.com> wrote: >>> >>>> Hi >>>> >>>> I am getting this error when I use it >>>> >>>> PWC6131: Attribute autocomplete invalid for tag textfield according to >>>> TLD >>>> at >>>> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:78) >>>> >>>> Thanks, >>>> -saeed >>>> >>>> >>>> On Fri, May 1, 2009 at 8:47 PM, Matt Raible <m...@raibledesigns.com>wrote: >>>> >>>>> If you need to pass request parameters, simply use >>>>> action.html?param1=value1¶m2=value2. >>>>> >>>>> Matt >>>>> >>>>> >>>>> On Fri, May 1, 2009 at 8:45 AM, Saeed Iqbal <saee...@gmail.com> wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> Thanks for your reply Matt. Would I pass request parameters. >>>>>> >>>>>> I like the first approach. >>>>>> >>>>>> Thanks, >>>>>> -saeed >>>>>> >>>>>> >>>>>> On Fri, May 1, 2009 at 8:36 PM, Matt Raible >>>>>> <m...@raibledesigns.com>wrote: >>>>>> >>>>>>> Yes, this should work. After all, it's all HTML in the end, so if you >>>>>>> can see the URL to your action (from a link or a form), you should be >>>>>>> able >>>>>>> to use that same URL for an Ajax call. >>>>>>> >>>>>>> Another option is to change Struts to use the default extension of >>>>>>> .action and then you should be able to use the Ajax them w/o issues. >>>>>>> >>>>>>> Matt >>>>>>> >>>>>>> >>>>>>> On Fri, May 1, 2009 at 7:52 AM, Saeed Iqbal <saee...@gmail.com>wrote: >>>>>>> >>>>>>>> Hi >>>>>>>> >>>>>>>> I am able to map classes to URLs and it seems thats what we need to >>>>>>>> do for javascript as i understand. Can someone tell me more please. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> -saeed >>>>>>>> >>>>>>>> >>>>>>>> On Fri, May 1, 2009 at 2:22 PM, Saeed Iqbal <saee...@gmail.com>wrote: >>>>>>>> >>>>>>>>> Yes I agree with you it has autocomplete but how can we use ajax >>>>>>>>> theme >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> -saeed >>>>>>>>> >>>>>>>>> 2009/5/1 Magnús Skúlason <magg...@gmail.com> >>>>>>>>> >>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> Struts 2 has a specific auto complete tag, see here >>>>>>>>>> http://www.roseindia.net/struts/struts2/struts2uitags/autocompleter-example.shtml, >>>>>>>>>> so you only need to populate a list with the suggestions in the >>>>>>>>>> action >>>>>>>>>> executed before showing the jsp. >>>>>>>>>> >>>>>>>>>> best regards, >>>>>>>>>> Magnus >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Fri, May 1, 2009 at 10:07 AM, Saeed Iqbal >>>>>>>>>> <saee...@gmail.com>wrote: >>>>>>>>>> >>>>>>>>>>> Hi >>>>>>>>>>> >>>>>>>>>>> Can anyone tell me how to call struts method from javascript >>>>>>>>>>> please for autocomplete >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> -saeed >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Saeed Iqbal >>>>>>>>> CEO - Iqbal Consulting >>>>>>>>> http://www.iqbalconsulting.com >>>>>>>>> +92-345-5444410 >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> Saeed Iqbal >>>>>>>> CEO - Iqbal Consulting >>>>>>>> http://www.iqbalconsulting.com >>>>>>>> +92-345-5444410 >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Saeed Iqbal >>>>>> CEO - Iqbal Consulting >>>>>> http://www.iqbalconsulting.com >>>>>> +92-345-5444410 >>>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> Saeed Iqbal >>>> CEO - Iqbal Consulting >>>> http://www.iqbalconsulting.com >>>> +92-345-5444410 >>>> >>> >>> >>> >>> -- >>> Saeed Iqbal >>> CEO - Iqbal Consulting >>> http://www.iqbalconsulting.com >>> +92-345-5444410 >>> >> >> >> >> -- >> Saeed Iqbal >> CEO - Iqbal Consulting >> http://www.iqbalconsulting.com >> +92-345-5444410 >> > > -- Saeed Iqbal CEO - Iqbal Consulting http://www.iqbalconsulting.com +92-345-5444410