struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <maill...@reumann.net>
Subject How to avoid a scriplet and make this cleaner?
Date Tue, 02 Jul 2002 02:22:29 GMT
For this example I have an ArrayList of "cars" (which are CarBeans
with String carName, int id ). I want to iterate over this ArrayList
and set up each car name with a checbox next to it with the id as the
value. My FormBean has the property String[] carID to get the cars
selected.

The problem is I can't seem to avoid using a scriplet and can't seem
to use the checkbox tag to set up the following:

<logic:iterate id="element" name="cars" >
  <TR>
    <TD><bean:write name="element" property="carName"/></TD>
    <TD>
      <input type="checkbox" name="carID" value="<%= ((CarBean)element).getId() %>"/>
    </TD>
 </TR>
</logic:iterate>

I want to avoid having to use the scriplet for the value above. I also
get errors when I try to use the tag for the checkbox with the
scriplet:

<html:checkbox property="carID" value="<%= ((CarBean)element).getId() %>" />


Any ideas how I can make the above code cleaner and/or get the
checkbox tag to work?

TIA

--

Rick

mailto:maillist@reumann.net


--
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