Take a look at the html generated by the tag, is there an initialKey
-attribute and what is it's value? If it is "29" then it's working for the
key part at least.

Of course I forgot to say that you need to set both the initial value and
the initial key. You can set the value with the value attribute. It's not
very nice solution but it works. <s:autocompleter value="%{initialValue}"
... />



On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:


It´s not working to me ....

<s:autocompleter  name="countryId" list="countries"  listKey="countryId"
listValue="country" label="Country" notifyTopics="/Changed"  />

I´ve setted the in the action countryIdKey = "29" and the combo comes
blank...

help me

Herrera




Toni Lyytikäinen wrote:
>
> Whoops, sorry I should probably think before I post. So you want to set
> the
> key, not the value of the input element. I did this by having a
> getElementKey-method in the Action class which returns the key you want
as
> the default. Element is the name of the input element.
>
> On 7/12/07, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote:
>>
>> The value attribute sets the preset value of the input element, if that
>> is
>> what youre looking for.
>> <s:autocompleter value="AS" etc... />
>>
>> On 7/12/07, Pedro Herrera <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > I´m using autocompleter tag with Struts 2.0.8 and I need to show a
>> > default
>> > value to the user.
>> >
>> > For example, in the JSON list :
>> >
>> > [
>> > ["Alabama","AL"],
>> >         ["Alaska","AK"],
>> >         ["American Samoa","AS"],
>> > ...
>> >
>> > I need to show by default 'AS(id) - American Samoa' . How I do this ?
>> >
>> >
>> > Herrera
>> >
>> >
>> > --
>> > View this message in context:
>> >
>>
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11556982
>> > Sent from the Struts - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>
>

--
View this message in context:
http://www.nabble.com/-S2--autocompleter%2C-predefining-initial-value-tf4067166.html#a11559311
Sent from the Struts - User mailing list archive at Nabble.com.


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


Reply via email to