struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodrigo Pereira" <rodpereira...@gmail.com>
Subject Re: 2.0.11: s:autocompleter
Date Mon, 24 Dec 2007 17:11:46 GMT
Hi,
I am able to make it work in FF, but not in IE 6.0.
Is there any problems with s:autocompleter and IE? I checked show-case
example and it does not work as well.

Thanks,
Rodrigo Pereira

On Dec 15, 2007 4:53 PM, Rodrigo Pereira <rodpereira.rj@gmail.com> wrote:
> I got it as well.
> Changing the "name" parameter to "keyName" works.
>
> Thanks,
> Rodrigo Pereira
>
>
> On Dec 15, 2007 3:03 PM, Rodrigo Pereira <rodpereira.rj@gmail.com> wrote:
> > I got it. :)
> > All magic is behind freemaker.
> >
> > dropdown.jsp:
> >
> > <%@ page contentType="text/html;charset=UTF-8" language="java" %>
> > <%@ taglib prefix="s" uri="/struts-tags" %>
> > <html>
> > <head>
> > <title>Dropdown - Example</title>
> > <s:head theme="ajax"/>
> > </head>
> > <body>
> >
> > <form id="selectForm">
> >         <s:autocompleter theme="simple" name="upperValue" list="upper"
> > listValue="name" listKey="valueId" notifyTopics="/refresh" />
> > </form>
> >
> > <s:url id="lower" action="lower" namespace="/dropdown"/>
> > <s:autocompleter theme="ajax" name="lowerValue" href="%{#lower}"
> > formId="selectForm" listenTopics="/refresh" />
> >
> > </body>
> > </html>
> >
> >
> >
> > struts.xml
> >
> > <package name="dropdown" namespace="/dropdown" extends="struts-default">
> >
> >                 <action name="upper" class="dropdown.DropdownAction" method="upper">
> >                         <result>/dropdown.jsp</result>
> >                 </action>
> >
> >                 <action name="lower" class="dropdown.DropdownAction" method="lower">
> >                         <result type="freemarker">/options.ftl</result>
> >                 </action>
> >
> >         </package>
> >
> >
> > options.ftl
> >
> > [
> > <#list lower as option>
> >         ["${option.name}", "${option.valueId}"],
> > </#list>
> > ]
> >
> > DropdownAction:
> >
> > public class DropdownAction extends ActionSupport{
> >
> >         List<Value> upper = new ArrayList<Value>();
> >         List<Value> lower = new ArrayList<Value>();
> >
> >         private String upperValue;
> >         private String lowerValue;
> >
> >
> >         public String doUpper(){
> >
> >                 upper.add( new Value(1,"A") );
> >                 upper.add( new Value(2,"B") );
> >
> >                 return SUCCESS;
> >         }
> >
> >         public String doLower(){
> >
> >                 lower = new ArrayList<Value>();
> >
> >                 if( upperValue.equalsIgnoreCase("A") ){
> >                         lower.add( new Value(1,"a1") );
> >                         lower.add( new Value(2,"a2") );
> >                 }else{
> >                         lower.add( new Value(1,"b1") );
> >                         lower.add( new Value(2,"b2") );
> >                 }
> >
> >                 return SUCCESS;
> >         }
> >
> >         // geters and seters
> > }
> >
> > Now I'd like to pass forward to my action list key value instead of list value.
> >
> > Thanks,
> > Rodrigo Pereira
> >
> >
> > On Dec 15, 2007 2:32 PM, Martin Gainty <mgainty@hotmail.com> wrote:
> > > Rodrigo-
> > >
> > > There is a bug I logged on autocompleter..hopefully we'll have a patch soon
> > > https://issues.apache.org/struts/browse/WW-2373
> > > Since you and I are the only folks following this do you want to take a
> > > quick glance at this?
> > >
> > > Saludos desde EEUU
> > > Martin-
> > >
> > > ----- Original Message -----
> > > From: "Rodrigo Pereira" <rodpereira.rj@gmail.com>
> > > To: "Struts Users Mailing List" <user@struts.apache.org>
> > > Sent: Saturday, December 15, 2007 10:34 AM
> > > Subject: Re: 2.0.11: s:autocompleter
> > >
> > >
> > > > Hi,
> > > > does anybody have an example of s:autocompleter getting list value
> > > > from an action?
> > > > I have been trying to update a list based on the selection of another
> > > > one, but no success. I'd like the dropdown lists not hardcoded as
> > > > showcase example does.
> > > >
> > > > Thanks,
> > > > Rodrigo Pereira
> > > >
> > > >
> > > > On Dec 11, 2007 4:50 PM, Rodrigo Pereira <rodpereira.rj@gmail.com>
wrote:
> > > > > Hi,
> > > > > I tried that but it only loads 1st dropdown, the 2nd is never updated.
> > > > >
> > > > > <form id="selectForm">
> > > > >
> > > > >         <s:autocompleter theme="simple" name="upperValue" list="upper"
> > > > > listValue="name" listKey="valueId" notifyTopics="/changeLower"/>
> > > > >
> > > > > </form>
> > > > >
> > > > > <s:autocompleter theme="ajax" name="lowerValue" list="lower"
> > > > > listValue="name" listKey="valueId" listenTopics="/changeLower"
> > > > > formId="selectForm"/>
> > > > >
> > > > >
> > > > > Thanks,
> > > > > Rodrigo Pereira
> > > > >
> > > > >
> > > > > On Dec 11, 2007 4:42 PM, Dave Newton <newton.dave@yahoo.com>
wrote:
> > > > > > --- Rodrigo Pereira <rodpereira.rj@gmail.com> wrote:
> > > > > > > this way you're hard coding the 1st dropdown list.
> > > > > > > I'd like to get it from an action.
> > > > > >
> > > > > > So use a value from the action instead of an immediate OGNL
value.
> > > > > >
> > > > > > > By the way, how does the 2nd dropdown get updated?
> > > > > >
> > > > > > Via the notify/listen topics.
> > > > > >
> > > > > > d.
> > > > > >
> > > > > >
> > > > > >
> > > > > > ---------------------------------------------------------------------
> > > > > > 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
> > > >
> > > >
> > >
> > >
> >
>

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


Mime
View raw message