This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes form with multibox on several pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "form with multibox on several pages " Watch "form with multibox on several pages " New topic
Author

form with multibox on several pages

Mickey O'Rourke
Greenhorn

Joined: Sep 20, 2006
Posts: 1
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

Joined: Jan 10, 2002
Posts: 60077
    
  65

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    5

"Mickey O'Rourke"

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

-Scott


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form with multibox on several pages
 
Similar Threads
multibox , resultSet, logic:iterate
Checkbox and Multibox validation
Iterator and multibox
struts and multibox
Multibox issue with DynaValidatorForm