struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maturo, Larry" <larry_mat...@AthensGroup.com>
Subject RE: How to use <html:radio>?
Date Mon, 25 Feb 2002 20:10:59 GMT
Hi Dave,

My scope is session.  We use session for all our
actions.  As to other indexed fields, yes, but
this one is different.  In the others your results
end up in the form bean.  In this one, there is no
way to specify output different than the input.  For
example, in the select/options tags, you specify
were the output goes in the select tag, and the
options essentially come from a read-only list.
In the radio buttons tags, output and input are
in the same list.  I suspect this is the real
problem, but I don't know what to do differently.

-- Larry


-----Original Message-----
From: dhay@lexmark.com [mailto:dhay@lexmark.com]
Sent: Monday, February 25, 2002 1:45 PM
To: Struts Users Mailing List
Subject: RE: How to use <html:radio>?



Larry,

Are the other indexed fields working okay?  What scope is your bean in?

Cheers,

Dave





"Maturo, Larry" <larry_maturo@AthensGroup.com> on 02/25/2002 01:57:16 PM

Please respond to "Struts Users Mailing List"
       <struts-user@jakarta.apache.org>

To:    'Struts Users Mailing List' <struts-user@jakarta.apache.org>
cc:
Subject:    RE: How to use <html:radio>?


Hi Dave,

I actually do have indexed set to true:

<html:radio  name="ppg" property="<%= ProjectForm.STATUS %>"
value="<%=ProcessStatus.EXEMPT.getMnemonic() %>" indexed="true" />

-- Larry



-----Original Message-----
From: dhay@lexmark.com [mailto:dhay@lexmark.com]
Sent: Monday, February 25, 2002 12:04 PM
To: Struts Users Mailing List
Subject: Re: How to use <html:radio>?



Hi Larry,

problem is that you are creating a bunch of radio buttons all with the same
name throughout the page, due to iterate loop.

You need indexed naming so struts can autopopulate the relevant fields.

Cheers,

Dave





"Maturo, Larry" <larry_maturo@AthensGroup.com> on 02/22/2002 04:46:44 PM

Please respond to "Struts Users Mailing List"
       <struts-user@jakarta.apache.org>

To:    'Struts Users Mailing List' <struts-user@jakarta.apache.org>
cc:
Subject:    How to use <html:radio>?


I am trying to create a table of radio buttons.  Each row looks
something like:

Required Exempt Done       Gate
   O       O      *     Repository Link

where the "O" represents an unchecked radio button
and the "*" represents a check one.  I have an ArrayList
of beans.  Each bean has a status string field and a gate
string field, where status is always one of "REQUIRED",
"EXEMPT", or "DONE".  My table displays properly, and I can
change which radio button is selected.  However, when I
make a change to one of the radio buttons and submit my
form, the list I get back is identical to the
one I sent in.  Below is what's in my jsp:

<table border="">
  <tr>
    <td colspan="3"><b><big><center>Status</center></big></b></td>
    <td></td>
    </tr>
  <tr>
    <td align="center" width="80"><b>Required</b></td>
    <td align="center" width="80"><b>Exempt</b></td>
    <td align="center" width="80"><b>Done</b></td>
    <td align="center" width="150"><b><big>Gate</big></b></td>
  </tr>
    <logic:iterate id="ppg" name="<%= Constants.PROJECT_PROCESS_GATE_LIST
%>" scope="session"

type="com.athensgroup.model.ProjectProcessGate">
  <tr>
    <td>
      <center>
        <html:radio name="ppg" property="<%= ProjectForm.STATUS %>"
value="<%=
ProcessStatus.REQUIRED.getMnemonic() %>" indexed="true" />
      </center>
    </td>
    <td>
      <center>
       <html:radio  name="ppg" property="<%= ProjectForm.STATUS %>"
value="<%=
ProcessStatus.EXEMPT.getMnemonic() %>" indexed="true" />
      </center>
    </td>
    <td>
      <center>
            <html:radio  name="ppg" property="<%= ProjectForm.STATUS %>"
value="<%=
ProcessStatus.DONE.getMnemonic() %>" indexed="true" />
      </center>
    </td>
    <td>
     <center>
       <bean:write name="ppg" property="<%= ProjectForm.GATE %>" />
     </center>
   </td>
  </tr>
  </logic:iterate>
  </table>

In my action class I have
request.getSession
().setAttribute(Constants.PROJECT_PROCESS_GATE_LIST,ppgLis
t);

After I submit my form I get the list back, in my action, with:
ppgList = (ArrayList)
request.getSession().getAttribute(Constants.PROJECT_PROCESS_GATE_LIST);

Why is this list identical to when it was sent in?

-- Larry Maturo
   lmaturo@athensgroup.com

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








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


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








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


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


Mime
View raw message