2

I want to retain the check boxes values which are previously checked on the first page, then user moves on the next pages and make additional selection.

Due to my current code, whenever user click Next or Previous link of display tag, the track of previously selected check boxes is lost.

I checked the this demo, but I don't get the idea clearly. Actually I want to get the functionality of that example.

<display:table class="displayTable" id="allUserList"
        name="allUserList" requestURI="viewList.action?" pagesize="15"
        defaultsort="2" defaultorder="ascending" sort="list">
        <display:column class="colID" paramId="sid" paramProperty="userId" >
            <input type="checkbox" name="sid" id="sid" value="${allUserList.userId}" class="checkSID">
        </display:column>
        <display:column class="colUserName" property="fullname" 
            title="User Name" sortable="true" headerClass="sortable" maxLength="50" />
</display:table>

Now I can get the data of the checkboxes when goes to action on clicking the button. I want to let the user to make selection has much as he likes before he hits the button. So he can browse as many pages as he likes and makes selection.

Tom11
  • 2,419
  • 8
  • 30
  • 56
kitokid
  • 3,009
  • 17
  • 65
  • 101
  • I think it'd be difficult to cause the checkboxes to persist unless they were already persisted elsewhere. Do you have some sort of way to do that? – Makoto Sep 24 '12 at 19:45

1 Answers1

0

Have you used the org.displaytag.decorator.CheckboxTableDecorator, which will add the Checkboxes to your paginated list. It requries two fields, Id and FieldName. Id should be one of the class member of the respective bean class, and you can give any FieldName to the field. You have to include this inside a form element. And the same form name has to be given in the DisplayTag's form attribute.