You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john feng <jo...@gmail.com> on 2007/11/29 04:22:35 UTC

struts action form vs # of multibox fields determined at runtime

I have a jsp page that produces a matrix page based on database queries for
both column header records and row records. The column and row crossed
fields are displayed as multiboxes, i.e., each vertical column of those is a
multibox field named as "crossCheckBox0", "crossCheckBox1",
"crossCheckBox2", ...starting from left to right. The number of those
columns is determined at run time by database queries.

If the number of fields is known at design time, 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 not design time
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 <input type="checkbox"... field instead of
><html:multibox...>.

May anyone have experienced this issue before and would like to shed some
light on it? I would appreciate a ton for the insight.