- Iterator tags using radio iterative pass-through values
JSP page code:
<struts:iterator value= "Checkboxs" status= "St" >
<td><struts:radio name= "checkresultarray[%{#st. Index}]" list= "result" listkey= "key" listvalue= "value" Value= "Boxinfocheckresult" ></struts:radio></td>
</struts:iterator>
where list= "result": Result is an enumeration collection, value= "Boxinfocheckresult": Boxinfocheckresult is the corresponding field of the bean in Checkboxs.
Background Action Code:
private static int boxnum;
Private boolean[] Checkresultarray=new Boolean[testnum];
Public boolean[] Getcheckresultarray () {
return checkresultarray;
}
public void Setcheckresultarray (boolean[] checkresultarray) {
This.checkresultarray = Checkresultarray;
}
Where Boxnum is the number of boxes determined for the previous operation.
- Iterator tags using input iteration pass value
JSP page code:
<struts:iterator value= "Checkboxs" status= "St" >
<td><input type= "text" class= "int" name= "Checkexplainarray[<struts:property value= ' #st. index '/>]" Value= "<struts:property value= ' Boxinfocheckresultexplain '/>" ></td>
</struts:iterator>
where value= "Boxinfocheckresultexplain": Boxinfocheckresultexplain is the corresponding field of the bean in Checkboxs.
Background Action Code:
private static int boxnum;
Private string[] Checkexplainarray=new String[testnum];
Public string[] Getcheckexplainarray () {
return checkexplainarray;
}
public void Setcheckexplainarray (string[] checkexplainarray) {
This.checkexplainarray = Checkexplainarray;
}
Where Boxnum is the number of boxes determined for the previous operation.
Struts2 iterator tags using radio/input iterative pass-through values