Ok, I finally managed to make it work.

so now the answer...

as I said, I did it exactly the same way as the example:

<form id="selectForm">
<sx:autocompleter theme="simple" name="select" list="{'fruits','colors'}" 
value="colors" notifyTopics="/Changed" />
</form>
Autocompleter 2 <sx:autocompleter href="%{#autoex}" formId="selectForm"
listenTopics="/Changed"/>

and here we never get the result (the selected thing). Of course if we want
to have it we have to add name="mySelectedValue" and have a
setMySelectedValue in the action class.
This value should be necessary, for example, to generate a third list, or
whatever.

But what I didn't know was that we have to surround the second autocompleter
by
<s:form id="selectForm2">...</s:form>, and to reference it to the tag which
needs it.

now I realize, as expected, that the solution was really simple, but I
hadn't seen this explanation anywhere before...



sassien wrote:
> 
> Yes I mean to use the value on my action, and I did set name="myVar" and I
> do have a "myVar" field and a public setMyVar() method on my action.
> This is strange, because when I write my autocompleter this way:
> <sx:autocompleter  name="myValue" list="{'fruits','colors'}"
> valueNotifyTopics="/changed" />
> 
> here the value is "stored" and I can use it in my action.
> 
> But if I write exactly the same autocompleter, but using an action, like
> here:
> <sx:autocompleter  href="%{jsonList}" name="myValue"
> valueNotifyTopics="/changed" />
> 
> ... in this case it doesn't work... I mean the select box does work, it is
> displayed, but no value is returned to the action. :-\
> 
> so I guess I must do something wrong, but I have to say I really don't
> know what.
> Maybe I have to specify that the action I use to fill the list is not the
> same as the one which get the results.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2.1-autocompleter%2C-get-the-value-tp16307105p16325039.html
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