You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov> on 2007/05/29 18:24:42 UTC

[S2] html:multibox in S2

I am experiencing multi selection boxes in Struts 2.  I have a list of checkboxes in a table that spreads to more than one page.  I am using the displaytag for the table.  Here is my attempt
 
 
<s:form name="grantResults" >        
<display:table name="test" id="grants" ...>
  <display:column title="Select" >
  <s:checkbox name="selectedGrants" fieldValue="${grants.id}" />
  </display:column>   
   
  <display:column ... />
</display:table>
</s:form>
 
In my action class, I defined selectedGrants as
    private String[] selectedGrants;

I can get the selection from the action, and selections are saved when user page and sort the table.  However, the checkbox does not show the selection that is saved in the session.

I searched the archive and found this thread that addressed the issue I have.  

http://marc.info/?l=struts-user&m=117804988331238&w=2

So I tried to convert my checkbox to checkboxlist.  However, I could not get the list and listKey attributes right. 

Please help.  Thank you,

Jane