Hi, I am using autocomplete feature (using prototype.js) for the name field.
<input name="company" type="text" value="name" MAXLENGTH=50/> <script type="text/javascript"> Event.observe(window, "load", function() { var aa = new AutoAssist("company", function() { return "nameListServlet?q=" + this.txtBox.value; }); }); </script> The list is obtained from DB by the nameListServlet. I am facing issues with special characters. For example, if the name in the DB is "clienté" then the value comes on the text drop down as "client?" (If I run the nameListServlet servlet seperately and not part of this implementation then I get the correct value as "clienté") Any idea on how to solve this? Thanks in advance, Bharat -----Original Message----- From: Samere, Adam J [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 6:17 PM To: Struts Users Mailing List Subject: RE: ajax:autocomplete tag You can forward to a JSP from your action rather than coding tags into your action, then generate XML in your JSP rather than HTML. Your JSP (aside from taglib directives etc) may look like this: <?xml version="1.0" encoding="UTF-8"?> <ajax-response> <response> <c:forEach var="user" items="${requestScope.users}"> <item> <name><c:out value="${user.userName}"/></name> <value><c:out value="${user.id}"/></value> </item> </c:forEach> </response> </ajax-response> -Adam -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 8:01 AM To: user@struts.apache.org Subject: RE: ajax:autocomplete tag Hi That was what I ment - You don't return any values from your action. You need to write the values to the response (supplied by the action), and then return null. The documentation at http://ajaxtags.sourceforge.net shows you how, or search for Struts and returning a file for instance. Hermod -----Original Message----- From: Sony Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 1:55 PM To: Struts Users Mailing List Subject: Re: ajax:autocomplete tag Hi Hermod, I am setting the value entered in the textbox parameters="username={username}" username is my textfield name. The problem is How will I return the username list back to jsp from action. It is very very urgent. can anyone help me please sony [EMAIL PROTECTED] wrote: > Hi > > You are not setting any values in the request - How can the list be > populated if you don't supply any values > > Hermod > > -----Original Message----- > From: Sony Thomas [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 14, 2006 1:09 PM > To: user@struts.apache.org > Subject: ajax:autocomplete tag > > > Hi, > > I am a newbie in ajax. I want to use ajax in my application. Let me > explain my requirement : > > when I enter a character in the text field i have to call an action. > Inside my action i have to load all the users and send it back to jsp > so that I can display. > > I am able to call the action class from my jsp. But my problem is how > will I set the list of users to response.Can anyone help me please ???? > > > What to do in my action to show the Userlist in jsp ? Please it is > very urgent ???? > > Here is my jsp code : > > <form action="taskSave"> > <input id="username" name="username" type="text" size="30" > class="form-autocomplete" /> > </form> > <ajax:autocomplete > baseUrl="/enterpriseUI/userAjaxComplete.do" > source="username" > target="username" > parameters="username={username}" > className="testcomplete" > minimumCharacters="1"/> > > > > Here is my Action class code : > > public ActionForward execute(ActionMapping mapping, ActionForm form, > HttpServletRequest request, > HttpServletResponse response) { > > > logger.info("********** Inside ajaxAutoCompleteAction ********** "); > try{ > ArrayList usersList = (ArrayList)UserManager.loadAll(); > > // return new AjaxXmlBuilder().addItems(usersList, "model", > "make").toString(); > }catch(BusinessObjectException e){ > e.printStackTrace(); > } > return mapping.findForward("success"); > } > > > > Thanks in advance > > > Sony Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the DnB NOR > Group cannot accept any payment orders or other legally binding > correspondence with customers as a part of an email. > > This email message has been virus checked by the anti virus programs > used in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS******** End of Disclaimer ********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]