Struts2 iterator tags using radio/input iterative pass-through values

Source: Internet
Author: User

    • 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.