struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rubbinio <rsolo...@n-able.com>
Subject Re: s2 : checkbox and checkboxlist : dynamic lists
Date Mon, 14 Jan 2008 20:09:33 GMT

Struts 2.0.11
Nope, no documentation just many attempts until we got it to work.

The class looks like this:

public class OurAction extends ActionSupport implements SessionAware,
ParameterAware, ParameterNameAware {
.....
private String[] selectedGroup;
.....

public void setSelectedGroup(String[] selectedGroup) {
      this.selectedGroup = selectedGroup;
}

The JSP:

<s:form action="ourAction" id="ourForm">
.....
   <s:iterator id="rowData" value="myList">
          .....
          <s:checkbox name="selectedGroup"
fieldValue="%{id}_%{nextCell.label}" theme="simple"/>
          .....
    </s:iterator>
.....
</s:form>


The mapping in struts.xml

<action name="*ourAction" class="package.ourAction" method="{1}">
    <interceptor-ref name="defaultStack"/>
    .....
    results set here
    .....
</action>

-- 
View this message in context: http://www.nabble.com/s2-%3A-checkbox-and-checkboxlist-%3A-dynamic-lists-tp14760993p14812186.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message