I tried to start with a direct port of what's in the YUI Plugin docs.
Taking out the # didn't seem to change anything. I was working against
the 2.1.0 SNAPSHOT, but trying it against 2.1.0 didn't seem to make a
different. There's 2.1.0-SNAPSHOT WAR here:

 * http://people.apache.org/~husted/retro.war

in case anyone wants to take a look. I know other people use this tag,
so it must work!

There are a couple of other things in the WAR (including Struts 1
stuff). To try the autocompleter, open the autocompleter.jsp directly.

-Ted.

On 10/6/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> is the action returning the expected JSON? The easiest way to debug
> problems is to just copy the generated javascript to your jsp and play
> with it (really small js section), and compare it to what the YUI docs
> say. Make sure that no css is getting applied to the autocompleter
> element, as that sometimes makes a mess.
>
> I gave you access to svn so if you find a problem..well you know ;)
>
> musachy
>
> On 10/6/07, Ted Husted <[EMAIL PROTECTED]> wrote:
> > I've got the YUI datepicker up easy enough, but I'm having trouble
> > with the autocompleter. I tried to adopt the starter code from the
> > wiki, but when I open the JSP, I only get a text input field and a
> > submit button. No select. In the MyEclipse Web 2.0 browser, I can see
> > the "query" request run, but the list is not displayed. Here's what I
> > have. (I'll post a WAR if it helps.)
> >
> > <%@ taglib prefix="yui" uri="/struts-yui-tags" %>
> > <%@ taglib prefix="s" uri="/struts-tags" %>
> > <html>
> > <head>
> >     <yui:head autocompleter="true" datepicker="true" />
> > </head>
> >
> > <body>
> >     <s:url id="statesUrl" action="autocompleter" includeParams='none'/>
> >     <s:form action="autocompleter">
> >         <yui:autocompleter id="state" name="state"
> > href="%{#statesUrl}" containerCssStyle="width:100px" />
> >         <s:submit />
> >     </s:form>
> > </body>
> > </html>
> >
> > <package name="yui" extends="json-default">
> >      <action name="autocompleter" class="actions.Autocompleter">
> >          <result type="json">
> >               <param name="root">options</param>
> >          </result>
> >      </action>
> > </package>
> >
> > package actions;
> > import com.googlecode.struts2yuiplugin.json.AutocompleterResult;
> > import com.opensymphony.xwork2.ActionSupport;
> > import java.util.Date;
> > public class Autocompleter extends ActionSupport {
> >     public String loadOptions() {
> >         return SUCCESS;
> >     }
> >     public AutocompleterResult getOptions() {
> >         AutocompleterResult result = new AutocompleterResult();
> >         if (query.equals("A")) {
> >             result.add("AL", "Alabama");
> >             result.add("AK", "Alaska");
> >         }
> >         return result;
> >     }
> >     private String state;
> >     public void setState(String value) {
> >         state = value;
> >     }
> >     private String stateKey;
> >     public void setStateKey(String value) {
> >         stateKey = value;
> >     }
> >     private String query;
> >     public void setQuery(String value) {
> >         query = value;
> >     }
> > }
> >
> > Any insight would be appreciated!
> >
> > TIA, Ted.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
HTH, Ted <http://www.husted.com/ted/blog/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to