• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

form with multibox on several pages

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 4356
45
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic