• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multidimensional array and multibox

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I�m trying to set a multidimensional array to hold the results of posts from a multibox.
Any thoughts on how to approach this? I�ve been doing the following without success.
My form has:
private String[][] checkingOptions = new String[MAX_NUM_PRODUCTS][0];
/**
* Returns the checkingOptions.
* @return String[][]
*/
public String[][] getCheckingOptions() {
return checkingOptions;
}

/**
* Sets the checkingOptions.
* @param checkingOptions The checkingOptions to set
*/
public void setCheckingOptions(String[][] checkingOptions) {
this.checkingOptions = checkingOptions;
}
My JSP looks like:
CheckingOptionCount holds the first index in to the multidimensional array. This will be zero for all the elements iterated over in the following code.
<logic:iterate id="checkingoptions" name="selectProductForm" property="checkingConvenienceOptions">
<%
String checkboxTarget = "checkingOptions[" + checkingOptionCount + "]";
%>
<html:multibox name="selectProductForm" property="<%= checkboxTarget %>"
value="<%= ((Map.Entry) checkingoptions).getValue().toString() %>"/>
<html:link href="" target="_blank">
<bean:write name="checkingoptions" property="key"/>
</html:link>

</logic:iterate>

Any pointers would be appreciated.
Thanks,
~rich
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic