You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Edward G. Dawson" <ed...@umich.edu> on 2001/02/13 15:04:42 UTC

Linking Select Box in Iterate to Database Column

I have a collection of multi-field database records I display as lines
of editable fields using form:iterate.  I want to display one of the
fields, acadwarnseq, as a select box.  When the page first appears, the
selectbox value for each acadwarnseq should match its database value
(i.e., if the db value is 3, "3" should be selected, etc.).  When I try
to display acadwarnseq as a select box, using JSP A, I get the following
message:

    org.apache.jasper.compiler.ParseException:
    C:\tomcat\webapps\psstuddef\defcViewUpdt.jsp(102,63)
    Attribute def has no value at

org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:499)

However, using a similar bean reference to display acadwarnseq as a text
box (JSP B) works fine.   Anyone have any suggestions?

Thanks much,
Ed Dawson, Programmer, University of Michigan Medical School.

JSP A.
******

<slogic:iterate id="def"  name="deficienciesForm"
property="deficiencies" >
   <tr>
   .......
   <td align=center><SMALL>
      <sform:select property="tbaws"
       value="<sbean:write name="def" property="acadwarnseq" />" >
           <sform:options collection="AWS"
             property="value" labelProperty="label"/>
      </sform:select>
   </SMALL></td>
   .......
   </tr>
</slogic:iterate>


JSP B.
******

<slogic:iterate id="def"  name="deficienciesForm"
property="deficiencies">
   <tr>
   .......
   <td><SMALL><input type=text name="tbaws"
    value="<sbean:write name="def" property="acadwarnseq"/>"
    MAXLENGTH=1 SIZE=1></SMALL></td>
   .......
   </tr>
</slogic:iterate>