You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2007/10/07 00:11:26 UTC

Re: S2: YUI plugin and autocompleter

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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 2.0.9 OptionTransferSelect

Posted by Brian Trzupek <bt...@mac.com>.
I tried 2.0.10 and experienced the same problem. Does anyone have any  
ideas on this one?

Thanks,
Brian

On Oct 24, 2007, at 11:18 PM, Brian Trzupek wrote:

> I am trying to upgrade our app to 2.0.9 and having difficulty in the  
> optiontransferselect tag.
>
> Here is a sample of what a typical OTS tag looks like in our app:
>
> ---------------------------------------------------------------------------------------------------------
> <s:form name="editForm2" action="saveScanNotifications" theme="xhtml">
>                        <s:optiontransferselect
>                            theme="xhtml"
>                            label="%{getText('item.notifications')}"
>                            name="systemUsers"
>                            rightTitle="Users Notified by Scan"
>                            leftTitle="System User List"
>                            list="%{systemUsers}"
>                            listValue="email"
>                            listKey="id"
>                            allowAddToLeft="true"
>                            allowAddAllToLeft="true"
>                            allowUpDownOnLeft="true"
>                            multiple="true"
>                            headerKey="headerKey"
>                            headerValue="--- Please Select ---"
>                            emptyOption="true"
>                            doubleList="%{notificationUsers}"
>                            doubleListValue="email"
>                            doubleListKey="id"
>                            doubleName="notificationUsers"
>                            doubleHeaderKey="doubleHeaderKey"
>                            doubleHeaderValue="--- Please Select ---"
>                            doubleEmptyOption="true"
>                            doubleMultiple="true"
>                        />
> ---------------------------------------------------------------------------------------------------------
>
> In versions previous to 2.0.9, the associated action executes  
> perfectly and everything works. The execution order in the action  
> layer goes like this:
> 1) Prepare is called.
> 2) saveScanNotifications (method in Action mapped class) is called.
> 3) Prepare is called.
>
> In 2.0.9 the associated action executes in a different order and  
> thus throws NullPointerExceptions. Here is what happens in 209:
> 1) Prepare is called.
> 2) Prepare is called.
> 3) saveScanNotifications (method in Action mapped class) is called.
>
> When the above happens the first prepare works and retrieves the  
> object from the db by id correctly. When the second prepare happens,  
> all of a sudden there is no id to load , or object present from the  
> previous prepare. Almost like it is being called without any  
> knowledge of the request context. Then saveScanNotifications is  
> called and exceptions hit everywhere b/c the object was not loaded.
>
> Does anyone have an idea on what might have changed in 2.0.9 or  
> where we may have gone wrong?
>
> Thanks,
> Brian-
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


2.0.9 OptionTransferSelect

Posted by Brian Trzupek <bt...@mac.com>.
I am trying to upgrade our app to 2.0.9 and having difficulty in the  
optiontransferselect tag.

Here is a sample of what a typical OTS tag looks like in our app:

------------------------------------------------------------------------ 
---------------------------------
  <s:form name="editForm2" action="saveScanNotifications" theme="xhtml">
                         <s:optiontransferselect
                             theme="xhtml"
                             label="%{getText('item.notifications')}"
                             name="systemUsers"
                             rightTitle="Users Notified by Scan"
                             leftTitle="System User List"
                             list="%{systemUsers}"
                             listValue="email"
                             listKey="id"
                             allowAddToLeft="true"
                             allowAddAllToLeft="true"
                             allowUpDownOnLeft="true"
                             multiple="true"
                             headerKey="headerKey"
                             headerValue="--- Please Select ---"
                             emptyOption="true"
                             doubleList="%{notificationUsers}"
                             doubleListValue="email"
                             doubleListKey="id"
                             doubleName="notificationUsers"
                             doubleHeaderKey="doubleHeaderKey"
                             doubleHeaderValue="--- Please Select ---"
                             doubleEmptyOption="true"
                             doubleMultiple="true"
                         />
------------------------------------------------------------------------ 
---------------------------------

In versions previous to 2.0.9, the associated action executes  
perfectly and everything works. The execution order in the action  
layer goes like this:
1) Prepare is called.
2) saveScanNotifications (method in Action mapped class) is called.
3) Prepare is called.

In 2.0.9 the associated action executes in a different order and thus  
throws NullPointerExceptions. Here is what happens in 209:
1) Prepare is called.
2) Prepare is called.
3) saveScanNotifications (method in Action mapped class) is called.

When the above happens the first prepare works and retrieves the  
object from the db by id correctly. When the second prepare happens,  
all of a sudden there is no id to load , or object present from the  
previous prepare. Almost like it is being called without any  
knowledge of the request context. Then saveScanNotifications is  
called and exceptions hit everywhere b/c the object was not loaded.

Does anyone have an idea on what might have changed in 2.0.9 or where  
we may have gone wrong?

Thanks,
Brian-


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Ted Husted <hu...@apache.org>.
Right. My bad. Thanks. I see how this works now :)

On 10/7/07, Musachy Barroso <mu...@gmail.com> wrote:
> Did you try typing "A" instead of "a"? It is case sensitive, and it
> works for me (with "A")
>
> musachy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Musachy Barroso <mu...@gmail.com>.
Did you try typing "A" instead of "a"? It is case sensitive, and it
works for me (with "A")

musachy

On 10/7/07, Ted Husted <hu...@apache.org> wrote:
> 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 <mu...@gmail.com> 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 <hu...@apache.org> 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: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> HTH, Ted <http://www.husted.com/ted/blog/>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Ted Husted <hu...@apache.org>.
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 <mu...@gmail.com> 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 <hu...@apache.org> 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: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Ted Husted <hu...@apache.org>.
Hmmm, against the value stack, which includes the Action, among other things :)

We use the syntax without the # in the MailReader, for the
localization URLs, and it works just fine.

Of course, all this would be much simpler if WW-1517 were resolved :)

 * https://issues.apache.org/struts/browse/WW-1517

-Ted.

On 10/6/07, Dave Newton <ne...@yahoo.com> wrote:
> %{statesUrl} would try to resolve against the action,
> not the named object created by <s:url...>, no?
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Musachy Barroso <mu...@gmail.com>.
that's right

musachy

On 10/6/07, Dave Newton <ne...@yahoo.com> wrote:
> %{statesUrl} would try to resolve against the action,
> not the named object created by <s:url...>, no?
>
> --- Wes Wannemacher <we...@wantii.com> wrote:
>
> > Ted,
> >
> > Did you play around with the href= in your
> > yui:autocomleter? The %{#
> > doesn't look right to me, I would think that
> > %{statesUrl} should be
> > enough.
> >
> > -W
> >
> > On 10/6/07, Musachy Barroso <mu...@gmail.com>
> > 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 <hu...@apache.org> 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:
> > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the stone?"
> > Pink Floyd
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Wesley Wannemacher
> > President, Head Engineer/Consultant
> > WanTii, Inc.
> > http://www.wantii.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Wes Wannemacher <we...@wantii.com>.
(I could be wrong, as I really don't consider myself much more than a
Value Stack / OGNL n00b)

I think it just resolves it against the value stack, which the
variable was pushed onto by his s:url... This would be my assumption
as I have used it to create links like this -

<s:url id="someUrl" value="..." />
<a href="%{someUrl}">..</a>

Of course, just because it works, doesn't mean that my understanding
is correct :)

What looks goofy to me is that I've only used the '#' to refer to
specific objects in OGNL such as #request, #session, etc. I also know
that the '#' char is behind a few problems related to ELs clashing.

-Wes

On 10/6/07, Dave Newton <ne...@yahoo.com> wrote:
> %{statesUrl} would try to resolve against the action,
> not the named object created by <s:url...>, no?
>
> --- Wes Wannemacher <we...@wantii.com> wrote:
>
> > Ted,
> >
> > Did you play around with the href= in your
> > yui:autocomleter? The %{#
> > doesn't look right to me, I would think that
> > %{statesUrl} should be
> > enough.
> >
> > -W
> >
> > On 10/6/07, Musachy Barroso <mu...@gmail.com>
> > 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 <hu...@apache.org> 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:
> > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the stone?"
> > Pink Floyd
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Wesley Wannemacher
> > President, Head Engineer/Consultant
> > WanTii, Inc.
> > http://www.wantii.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Dave Newton <ne...@yahoo.com>.
%{statesUrl} would try to resolve against the action,
not the named object created by <s:url...>, no?

--- Wes Wannemacher <we...@wantii.com> wrote:

> Ted,
> 
> Did you play around with the href= in your
> yui:autocomleter? The %{#
> doesn't look right to me, I would think that
> %{statesUrl} should be
> enough.
> 
> -W
> 
> On 10/6/07, Musachy Barroso <mu...@gmail.com>
> 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 <hu...@apache.org> 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:
> user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?"
> Pink Floyd
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> >
> >
> 
> 
> -- 
> Wesley Wannemacher
> President, Head Engineer/Consultant
> WanTii, Inc.
> http://www.wantii.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Wes Wannemacher <we...@wantii.com>.
Ted,

Did you play around with the href= in your yui:autocomleter? The %{#
doesn't look right to me, I would think that %{statesUrl} should be
enough.

-W

On 10/6/07, Musachy Barroso <mu...@gmail.com> 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 <hu...@apache.org> 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: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: S2: YUI plugin and autocompleter

Posted by Musachy Barroso <mu...@gmail.com>.
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 <hu...@apache.org> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org