struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: Dynamic number of properties in an ActionForm?
Date Mon, 23 Jun 2003 04:09:22 GMT
The 'simple' way involves using properties that take an array
If your columns are foo, bar, etc... you could have:
setFoo(String[] foo)
setBar(String[] bar)

but... a *better* way would probably be to leverage the power of nested
action forms - where you have a property on your form whose value is a
collection of (nested) forms - each of which has the data for one row of the
table.

For a full tutorial check out the KeyboardMonkey site:
http://www.keyboardmonkey.com/next/index.jsp

-----Original Message-----
From: Bjorn T Johansen [mailto:btj@havleik.no]
Sent: Monday, 23 June 2003 11:52
To: struts-user@jakarta.apache.org
Subject: Dynamic number of properties in an ActionForm?


I have a little question. How do I setup a page with a form where I
don't know the number of properties in the form at design time? I have a
table of rows with a known number of columns but I don't know the number
of rows at design time, so how do I implement this using an ActionForm?
I need to read back the values also, not only display them...


Regards,

BTJ


----------------------------------------------------------------------------
-------------------
Bjørn T Johansen (BSc,MNIF)
Executive Manager
btj@havleik.no                  Havleik Consulting
Phone : +47 67 54 15 17         Conradisvei 4
Fax : +47 67 54 13 91           N-1338 Sandvika
Cellular : +47 926 93 298       http://www.havleik.no
----------------------------------------------------------------------------
-------------------
"The stickers on the side of the box said "Supported Platforms: Windows
98, Windows NT 4.0,
Windows 2000 or better", so clearly Linux was a supported platform."
----------------------------------------------------------------------------
-------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message