• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic