struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mreisz@4sxs.de" <mre...@4sxs.de>
Subject AW: Dynamic dropDown List
Date Fri, 21 Jan 2011 09:05:16 GMT
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:davelnewton@gmail.com] 
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, mreisz@4sxs.de 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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message