• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

How to retain checkbox value during pagination in struts

Posts: 1
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
Ranch Hand
Posts: 30
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic