struts action form vs # of multibox fields determined at runtime


Web tier: servlets, JSP, Web frameworks: struts action form vs # of multibox fields determined at runtime

  1. I have a jsp page that produces a matrix page based on database queries for both column header records and row records. The colun and row crossed fields are displayed as multiboxes, i.e., each vertical column is a multibox field named as "crossCheckBox0", "crossCheckBox1", "crossCheckBox2", ... The number of is determined at run time database query. If the number of fields is known design, then they can be added in to action form as String[] attibute, then one may take advantage of that struts would determine how many of the vertical boxes(rows) are checked at runtime. But now the number of mutlibox fields are dynamic and runtime determined, it is an unknown dimension array like crossCheckBox[#][#]...[#] where # stands for the number of rows being same. How to represent it in action form? Currently I have used javascript to loop thru the table to find out the each column's checked boxes and could not take advantage of struts multibox feature. Since I don't know how to add them into action form, I changed them into pure html . May anyone have experienced this issue before and would like to shed some light on it? I would appreciate a ton for the insight.
  2. I'm using struts 2.0, and if I had that issue, I should create a List attribute with List values. I mean, List> The first level are field names, the second level are values. And with struts 2.0 I could access by two "iterator" tags nested. But if the issue is very difficult to be solved (each value is a selectable list), I should consider to change the GUI layout. "Code must be easy to read" :)
  3. Thanks Carlo, you seems to not get my question[ Go to top ]

    The issue is that the number of multibox fields is determined at run time and it is not possible to add the attribute into actionform at design time. Each multibox is an array( or a list), but the number of these arrays or lists is unknown at design time. As I said that I looped the conventional checkbox using JS scripting to get the matrix (or called cross tab) feature done. But actionform cannot help.
  4. the matric or cross tab picture[ Go to top ]

    To help get the question, the matric or cross tab looks like below. The small letter "x" stands for check box. (column: grow direction->) |A|B|C|... |B|B|N|... |C|C|N|... ----------- r CA |x|x|x|... o NY |x|x|x|... w MI |x|x|x|... | ............. V .............