Hello,
I tried with a map, a set... and for the quest.questionId with [], $, #...
But nothing is working.
I think it is not possible to do this!?
My requirement:
A form with 4 pages and it is possible to navigate through the 4 pages without
loose field data. Example, a user fill the page 1 and 2, than goes to page 3
and begins to fill the fields. He remember that he did a mistake on the page 2,
go back (all the field are recovered with his answer), correct it and goes
again to page 3: here the field he answered before have to be recovered too.
All is working well with the <s:textfield> tag, the <s:select> ,
<s:checkbox>.... but the page 3 with dynamic dropDown List is not working:
<s:iterator value="questions" id="quest">
<s:property value="questionName"/>
<s:select name=" answers[quest.questionId]" list="answer"
listKey="answerId" listValue="answerName" headerKey="0" headerValue="Bitte
wählen"/>
</s:iterator>
Somebody know if it is possible to do that??
Thanks and regards,
Matthieu
-----Ursprüngliche Nachricht-----
Von: Dave Newton [mailto:[email protected]]
Gesendet: Donnerstag, 20. Januar 2011 19:39
An: Struts Users Mailing List
Betreff: Re: Dynamic dropDown List
On Thu, Jan 20, 2011 at 12:10 PM, [email protected] wrote:
> And in my bean I have the variable " private String[] answers;" with
> getter and setters...
>
You'd probably want a map, no?
> But it is not working.... and the variable " quest.questionId" is not
> replaced by the value.
>
Try with a # maybe.
Dave
From: Reisz Matthieu
Thank you for your answer. Do you mean something like this:
<s:iterator value="questions" id="quest">
<s:property value="questionId"/><br/>
<s:property value="questionName"/><br/>
<s:select name="answers[quest.questionId]" list="answers"/><br/><br/>
</s:iterator>
And in my bean I have the variable " private String[] answers;" with getter and
setters...
But it is not working.... and the variable " quest.questionId" is not replaced
by the value.
Other ideas?
Thanks and regards,
Mat
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]