I am having some trouble with some struts 1 interface code.  I have an
object that contains an unknown number of key/value pairs and I want to
display them in a checkbox where the checkbox value is the key and the
Label is the value.  I am having no problem iterating and binding the keys
to checkboxes, my problem is displaying the values because iterate can
only handle one array at a time.  Below is my code and any ideas would be
greatly appreciated:

Relevant JSP code:

<logic:iterate name="MyActionForm" property="idArray"
id="idArrayElement">
  <html:multibox name="MyActionForm" property="selectIdsArray">
    <bean:write name="idArrayElement" />
  </html:multibox>
  <bean:write name="<something goes here>"/> <br/>
</logic:iterate>

MyActionForm:

//imports ignored for brevity
public class MyActionForm extends ActionForm
{
protected String[] selectIdsArray = {};
protected String[] idArray = {"1","2","3","4"};
protected String[] valueArray = {"Value 1","Value 2", "Value 3", "value 4"};

public String[] getSelectIdsArray(){return selectIdsArray;}
public String[] getIdArray(){return idArray;}
public String[] getValueArray(){return valueArray;}

// Setter methods left out on purpose

}




-- 
Cheers,
Solid


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to