• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 1. Group html:radio problems with two collections

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've been studying carefully all the topics, examples, struts FAQ, etc, about radio buttons in Struts and still cant find a solution to my problem.

Basically I have to make a quiz with questions and answers that I gather from a database. There's no fixed number of questions nor fixed number of answers for each question. For my application, I've created beans "Question" and "Answer" (where Question has an ArrayList answers List).

In my JSP I would like to render different groups of radio buttons,but I'm completely unable to make them have different names (I'm using struts 1). I've tried indexed properties, but with a double loop (I have to iterate for both collections of questions and answers) its not working.

Another problem that I'm facing is that I dont know how to define the ActionForm for this problem. I guess I should have an array of Questions, but I'm struggling with it.


Any help will be apreciated. Thanks a lot in advance.
 
reply
    Bookmark Topic Watch Topic
  • New Topic