hi!
the problem was that i didn't have a get method for id and content.

Now my question is:

when i run the page, the source code writes the radio buttons like this:
<input type="radio" name="answer[#pos.index]"
id="getFirstVideo_answer_#pos_index_5" value="5"/>

what i need it to save the answer for each question.
how can i do it?
what variable do i have to declare in the action class and how do i
have to write the radiobutton value?


On Wed, Oct 14, 2009 at 2:13 AM, Lee Clemens <j...@leeclemens.net> wrote:
>
> It looks like you may be able to nest <s:iterator> tags to achieve this.
>
> <s:iterator value="%{questionsArrayFromActionClass}">
>        <s:property value="%{theQuestion}"/>
>        <s:iterator value="%{answersFromQuestionClass}">
>                <s:radio...
>        </s:iterator>
> </s:iterator>
>
> --Lee
>
> -----Original Message-----
> From: Odelya YomTov [mailto:ode...@jpost.com]
> Sent: Tuesday, October 13, 2009 6:09 PM
> To: 'Struts Users Mailing List'
> Subject: iterator and radio struts2
>
> Hi!
>
> I have the following class:
>
> public class Question implements Serializable {
>    private Integer id;
>    private String content;
>    private String type;
>    private List<Answer> answers = new ArrayList<Answer>();
>    .....
> }
>
> And class answer:
>
> public class Answer implements Serializable{
>    private Integer id;
>     private String content;
>    ....
> }
>
> I would like to iterate over the questions, and for each one display the
> option to choose the answer in a radio button.
>
> </snip>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>



--
what matters most is how you see yourself

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to