• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form with multibox on several pages

 
Mickey O'Rourke
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for taking the time to read my problem. I'm new to the struts framework and have a problem. Here's the situation:

I have a dynamic set of checkboxes being displayed using the multibox tag. The first ten boxes are displayed on page one, the next ten on page two, etc.

The form is declared in a JSP page which uses Tiles to display the page that shows the check boxes. Moving from page to page is done with a link that passes a parameter - the page index - to the action class which displays the desired set of checkboxes.

When the form is submitted, the boxes that were checked are saved into an array in the form-bean automatically by struts. The problem I am having is that if I check a box on page one, then move to page two, the fact that a box on page one was checked is lost and doesn't get put into the array. Only the check boxes on the current page gets saved into the array.

My problem is that I need all the checked checkboxes to be saved into the array. I am not sure if this is enough info but it's a start.

Thanks again for any advice, it's greatly appreciated.
G
[ September 20, 2006: Message edited by: Mickey O'Rourke ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64724
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"G B",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The complete solution might be a bit tricky. The basic problem is likely your link. Rather than link directly to another jsp or action, you need to submit your form when the user clicks the link (likely using some JavaScript code). That JavaScript also needs to set a property on your form that indicates what links was clicked so that you can determine what page needs to be shown. Are you saving your from in session scope?

- Brent
 
Scott Selikoff
author
Saloon Keeper
Posts: 4011
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Mickey O'Rourke"

Please re-read the naming policy on obviously fictitious names and choose a name more appropriate for this forum.

-Scott
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic