I double check this, and it seems to be working fine, as Wes mentioned
you need to escape "#" or use something like:
<sx:autocompleter name="state"
list="[EMAIL PROTECTED]@{'AL':'Alabama'}"/>
One think to keep in mind is, when you build the json, the key and
the values are in the "wrong" order. So it would be:
{
"Alabama" : "AL"
}
instead of :
{
"Al" : "Alabama"
}
I know it is confusing, but we inherited that from Dojo and changing
it would break backward compatibility.
regards
musachy
On 10/5/07, Wes Wannemacher <[EMAIL PROTECTED]> wrote:
> OGNL's anonymous map creation uses the '#' character -
>
> http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/collectionConstruction.html#mapConstruction
>
> But, if your servlet container uses the Unified EL, then you'll have
> to escape the '#',
>
> So, in short try this -
>
> <sx:autocompleter name="test" label="test" list="\#{'Alabama':'AL',
> 'Alaska':'AK'}" autoComplete="false"/>
>
>
> Looking at what you were trying makes me think that you were confused
> by the JSON string. It appears that there isn't mention of using a Map
> for the list= attrib, but I assume that it acts the same as it did in
> 2.0.x
>
> -W
> On 10/5/07, chengas123 <[EMAIL PROTECTED]> wrote:
> >
> > Turns out the problem is that the autocompleter is broken for maps. Using
> > the map example given in the documentation
> > (http://struts.apache.org/2.x/docs/autocompleter.html) does not work:
> > <sx:autocompleter name="test" label="test" list="{'Alabama':'AL',
> > 'Alaska':'AK'}" autoComplete="false"/>
> > However, it works when a list is given:
> > <sx:autocompleter name="test" label="test" list="{'AL', 'AK'}"
> > autoComplete="false"/>
> >
> > -Ben
> >
> >
> >
> > chengas123 wrote:
> > >
> > > Converting the tags to use the new library wasn't very hard except that I
> > > can't seem to get the new tags to work. I turned the debugging on in the
> > > head tag and the only debug message I got was "DEBUG: please consider
> > > using a mimetype of text/json-comment-filtered to avoid potential security
> > > issues with JSON endpoints." I've placed the relevant code from my .jsp
> > > below. Is there anything I forgot when converting to 2.1 besides the
> > > steps Nicholas mentioned? I do see my action being called when I type in
> > > the autocompleter box. If I manually visit the URL I am given the
> > > following JSON: {"1":"Internet Services"}
> > >
> > > <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
> > > <sx:head cache="true" debug="true" />
> > > <sx:autocompleter label="Department" forceValidOption="true"
> > > cssStyle="width:132px; height:18px; border:1px solid #7B9EBD"
> > > name="department" required="true" href="%{departmentList}"
> > > loadOnTextChange="true" showDownArrow="false"
> > > searchType="substring" />
> > >
> > >
> > > Thanks,
> > > Ben
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13064915
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Wesley Wannemacher
> President, Head Engineer/Consultant
> WanTii, Inc.
> http://www.wantii.com
>
> ---------------------------------------------------------------------
> 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]