This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

How does struts handle dynamic forms that grow and its retrieval?

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a page where a user can create an account using a form. Inside the form there is a table where they can add form elements (both text boxes and drop downs) dynamically using javascript to add as many new rows of inputs as the user wants.
I understand that when the input properties are stored as an array in the form bean, struts will automatically handle the inputs and set then into the appropriate arrays. However, when the user wants to "edit" their account, I have to display those rows of inputs they entered when they created the account. How does struts handle the order , will they be in the same order as the user entered? How do I tell the jsp to generate the x amount of input rows and populate each row correctly with what the user intially entered?
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you should specify which version of Struts you use. It seems like Struts 1 (you use "form bean"). For generating input boxes use logic tags
http://struts.apache.org/1.2.9/userGuide/struts-logic.html
in the scope of each iteration you can access the element and its value.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic