Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retain checkbox value during pagination in struts

 
Matheus Goncalves
Greenhorn
Posts: 1
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I'm stuck for 2 days trying to load a checkbox value, from the Action Form.

I need to delete all the selected items from an ArrayList<Person>, so I iterate this list, and put a checkbox before each item.
But when I click the button to delete the selected items, the Action Form reads the ArrayList, but the checkbox field is still empty. I'm clueless and I appreciate any help.

Here is the code:

The Checkbox:



The full code:



That's the verification I'm trying to do:



Here is the ValidateUserListAction :



The class Person is huge, but it has:



Here is the ValidateUserListForm :



And that's the code for struts-config.xml



What I am missing?
Thanks!
 
Pablo Abbate
Ranch Hand
Posts: 30
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has been a lot of time since I worked with the UI. But I remember a few things ...

If you wan't to hold the state of the checkboxes, when you paginate, you need to submit the values. (form)
Another way to do it, is an ajax method while you select an individual checkbox
If you unselect a check, the value doesn't go to the server, so I remember I needed to add a hidden tag with value=false.

Hope it helps.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic