This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form values accessed in Action code

 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a form that will be displayed to the user and it will show them between 0 and 20 textfields. All of them are editable. The issue that I am not sure how to solve is how would I go about getting the 0-20 variables out in the Action code. That is to say how would one go about pulling them back without the extremely ugly manner of pulling back each value on it's own.

A concrete example:
List of products on the screen.
User is able to modify quantity field on screen. After clicking submit I want to be able to pull back all 0-20 values so that I can update the values in the backend appropriately.



Any suggestions or thoughts would be greatly appreciated.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two words...indexed properties. Search this forum or the Internet and you are bound to find some information (there is a good page in the Struts FAQ on the apache site). Indexed properties can be a bit tricky, so come back if you have some specific questions.

- Brent
 
A knibbs
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great thanks for the starting point, I was running out of search phrases that made any sense.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic