You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jean, Victor [IT]" <vi...@citigroup.com> on 2003/06/17 00:49:56 UTC

Problem Using Multibox tag Across Multiple Pages

I have a problem where I need to keep track of  what checkboxes are selected across multiple pages.
I'm using the same form name/object and just passing a different set of available items on each page.

For example, let's say I check 2 different items on page one, then I navigate to page two
and check 4 items.  When I return to page one, those 2 items I selected are no longer
checked.  What's happening is the 4 items I selected on page two are overwriting the
selectedItem array instead of appending to the array.  Is there a struts solution for using
the multibox tag across multiple pages?


	I basically have a HUGE list of 10000 different accounts.
	I break this list down into 10 accounts a page and have a user select which accounts they 
	want.   So a user maybe selects 2 accounts on page one..then continues adding accounts
	going from page to page.  I need it so the selectedAccount array keeps getting appended
	as a user navigates between pages and checks accounts.  Right now it appears to be overwriting 
	the array.  


Thanks in advance for the help,

Victor

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Problem Using Multibox tag Across Multiple Pages

Posted by Jing Zhou <ji...@netspread.com>.
----- Original Message ----- 
From: "Jean, Victor [IT]" <vi...@citigroup.com>
To: <st...@jakarta.apache.org>
Sent: Monday, June 16, 2003 4:49 PM
Subject: Problem Using Multibox tag Across Multiple Pages


I have a problem where I need to keep track of  what checkboxes are selected
across multiple pages.
I'm using the same form name/object and just passing a different set of
available items on each page.

For example, let's say I check 2 different items on page one, then I
navigate to page two
and check 4 items.  When I return to page one, those 2 items I selected are
no longer
checked.  What's happening is the 4 items I selected on page two are
overwriting the
selectedItem array instead of appending to the array.  Is there a struts
solution for using
the multibox tag across multiple pages?


I basically have a HUGE list of 10000 different accounts.
I break this list down into 10 accounts a page and have a user select which
accounts they
want.   So a user maybe selects 2 accounts on page one..then continues
adding accounts
going from page to page.  I need it so the selectedAccount array keeps
getting appended
as a user navigates between pages and checks accounts.  Right now it appears
to be overwriting
the array.

Overwriting the array is the designed behavior of Struts. To avoid the
overwriting,
one way is to replace the array instance every time a page is forwarded. You
have to
record *visited* array instances and make sure the right array instance will
match
with its page. At the end of your wizard, you sum up all of the *visited*
array instances.

Jing

Thanks in advance for the help,

Victor

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org