You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by James Krygowski <ja...@shaws.com> on 2002/07/19 15:08:15 UTC

dynabeans, indexed text input fields

Hi All-

I'm using Struts 1.0.2 and would like to know how I could utilize the
DynaClass/DynaBean combination to handle the following situation:

My application displays several editable tables whose underlying data might
look like:

unique_id   description   cost  discount
---------   ------------   ----  --------
1		red widget     1.50  25%
2           blue widget    1.60  20%
3           green widget   1.00  50%

And the HTML would look like:

<input type="hidden" name="unique_id1" value="1"><input type="text"
name="description1" size="50" value="red widget">
<input type="hidden" name="unique_id2" value="2"><input type="text"
name="description2" size="50" value="blue widget">
<input type="hidden" name="unique_id3" value="3"><input type="text"
name="description3" size="50" value="green widget">

(I've purposely left out the inputs for the cost and discount because you
probably get the picture now)


How would I use dynabean/dynaclass to transport this data to and from my
html form and struts action?

I've played with the dynabean/dynaclass a bit and it seems like the right
direction to go.  What I don't understand is how it would parse the input
type's name (unique_id1, unique_id2, etc) to the name of a property in its
list.  Is this something that BeanUtils does?  If so, I'm not entirely sure
how BeanUtils does it and how that integrates within the existing Struts
services.  Could someone present an example based on the scenario I
described above?

Thanks,

Jim


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>