You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Maturo, Larry" <la...@AthensGroup.com> on 2002/02/04 23:40:52 UTC

RE: Indexed html:radio is broken

Dave Hay wrote:

What if you want, say,

   <logic:iterate id="category" name="TraceForm" property="categoryList">
            ...
            On <html:radio  name="category" property="value" value="on"
indexed="true"/>
            Off <html:radio  name="category" property="value" value="off"
indexed="true"/>
            Deferred <html:radio  name="category" property="value"
value="deferred" indexed="true"/>
            ...
     </logic:iterate>

That way the buttons SHOULD all have the same name for each iteration, and
different one for the next one etc..  That was the thinking behind it.

Dave



Will that not generate:

On <input type="radio" name="category[0].value" value="on">
Off <input type="radio" name="category[0].value" value="off">
Deferred <input type="radio" name="category[0].value" value="deferred">

On <input type="radio" name="category[1].value" value="on">
Off <input type="radio" name="category[1].value" value="off">
Deferred <input type="radio" name="category[1].value" value="deferred">

etc, where category must be an array?  If so, then what you really have
is a list of lists, since both TraceForm and category must be a list.

If so, what is the logic behind this?

What I would have expected is to pick up the names for radio groups from
category, and have html:raido use an array property within the Form Bean
for this action. This would look something like:

On <input type="radio" name="someValue[0]" value="on">
Off <input type="radio" name="someValue[0]" value="off">
Deferred <input type="radio" name="someValue[0]" value="deferred">
Group A

On <input type="radio" name="someValue1]" value="on">
Off <input type="radio" name="someValue[1]" value="off">
Deferred <input type="radio" name="someValue[1]" value="deferred">
Group B

where someValue is an array property within the form bean and "Group A",
"Group B", etc. are from a string property within category.

What I am trying to do is something like:

+-----------------------+-------------------+
|    Status         |   |                   |
+-------+--------+------+-------------------+
| Req'd | Exempt | Done |      Gate         |
+-------+--------+------+-------------------+
|   o   |   o    |  *   | Statement of Work |
+-------+--------+------+-------------------+
|   o   |   *    |  o   |      Kickoff      |
+-------+--------+------+-------------------+

-- Larry Maturo
   lmaturo@athensgroup.com

   

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