Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Element Array: Text-boxes 2D Array - How to... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Element Array: Text-boxes 2D Array - How to..." Watch "Element Array: Text-boxes 2D Array - How to..." New topic
Author

Element Array: Text-boxes 2D Array - How to...

Ganesh Ramani
Greenhorn

Joined: Aug 07, 2007
Posts: 20
I have a situation where the page has a table sreucture of text-box 2D array. The page must allow dynamic addition/removal of rows.

This is typically a kind of 2D element-array, which is array of text-boxes.

In struts, how this situation can be handled to retrieve data from form - where the rows are dynamic.

how action-form can be built to capture the data from the 2D text-box array?

Please help.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You can use indexed properties to create a dynamic table in Struts, but you must use a single-dimensional array or collection of JavaBeans. Multidimensional arrays are not supported for indexed properties. For more information on indexed properties along with a working example, see question 6 of the JavaRanch Struts FAQ
[ August 14, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Element Array: Text-boxes 2D Array - How to...
 
Similar Threads
saving the details in when i click next and previous buttons
Finding number of a rows in a resultset...
Array troubles...
variables in jsp
form with multibox on several pages