You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by er...@readingplus.com on 2003/11/03 17:33:36 UTC
Indexed tags struts 1.0
I would like to pass the String[] array results of a
select tag to an array set and in the form bean my object always seems to me an string and not a String[]?
Could someone let me know if I am doing something wrong?
jsp snippet:
<logic:iterate id="net" name="localProductInfo" property="network" indexId="netIn">
<tr>
<td width="50%" class="bullets" valign="top">
Network Product:
<b><bean:write name="net" property="product.productName" /></b>
</td>
<td width="50%">
<bean:define id="prodVersions" name="net" property="productVersions" />
<html:select name="localProductInfo" property='<%= "networkVersionList[" + netIn + "]" %>' multiple="true">
<html:options collection="prodVersions" property="id" labelProperty="version" />
</html:select>
</td>
</tr>
<td colspan="100%"> </td>
</logic:iterate>
form snippet
private ArrayList network;
private ArrayList networkVersionsList = new ArrayList();
private ArrayList assignedProducts = new ArrayList();
private ArrayList newProducts = new ArrayList();
private String networkSupportType;
private int networkSupportTypeId;
private String shippedDate;
public Object getNetworkVersionList(int key) {
if (networkVersionsList.size() > 0) {
return networkVersionsList.get(key + 1);
} else
return null;
}
public void setNetworkVersionList(int key, Object value) {
System.out.println("** adding networkVersion");
if (value == null){
System.out.println("*** NULL!");
} else {
System.out.println("_Size:" + networkVersionsList.size());
System.out.println("_--- 1 " + value.getClass());
// String[] test = (String[]) value;
// for (int c = 0; c<test.length; c++ ) {
// System.out.println(test[c]);
// }
}
networkVersionsList.add(value);
}
Eric Waite
Taylor Online
Java Developer
http://www.readingplus.com