First of all if you want to use indexed properties for your question
options you should use the nightly builds of Struts as 1.0 does not
support this.
What i would do is create a QuestionActionForm containing the question
and collection of possible answers. Answer object would have 2 fields
text and value (boolean). Then a jsp to display your question looking
like this :
<html:form action="submitQuestion">
<bean:write name="questionActionForm" property="question"/>
<logic:iterate id="currentOption" name="questionActionForm" property=
"options">
<br />
<bean:write name="currentOption" property="text"/>
<html:radio name="currentOption" property="text" indexed="true"/>
</logic:iterate>
</html:form>
Create an action to initialize your questionnaire by putting the
collection of questions into session and the first question then forward
to jsp.
Then create submitQuestion Action to handle user input and put next
question into session then forward to your jsp.
This should do.
I hope this will help you.
>Hi guys,
>I'm a newbie here with Struts, so please be patient!
>
>Here's my scenario:
>I'm creating a web application to create questionnaires. I'm creating
the Questionnaire itself on the first page, and then I create one
question per page.
>
>Each question may have several "options" (imagine multiple questions /
multiple or single answers).
>What I'm trying to do here is to create the iteration between the
question (1) and questionOptions (N).
>
>I have created a QuestionForm and a QuestionOptionForm. Does Struts
support such scenario? I saw the <logic:iterate> tag, but I'm not too
sure how to handle the tag itself and how to expect the ActionForms in
my Action class...
>
>Any help is appreciated.
>Regards,
>Marcelo.
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>