• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to retain checkbox value during pagination in struts

 
Greenhorn
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?
Thanks!
 
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.
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic