You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Wendy Cameron <ca...@usq.edu.au> on 2002/12/02 03:16:13 UTC

Search Results Forms

Has anyone come up with a good way to do checkbox form process with Scrolling search results?

Basically you have a list of search results each with a check box next to it.  You also have scrolling pages, so you have Page 1 | 2 | 3 links etc.

If you use the checkbox with the same name, this can be easily picked up in your form bean etc, however if the user scrolls back and forth through the result checking and unchecking items, this could lead to problems with elements having been checked add, but later they were unchecked etc, and you wouldnt know.

I think you could possible work it by numbering the checkbox name.  However you lose your ability to automatically populate a form bean.
Where the ideal situation is an array 0..n-1 where n is the length, with a set of values, checked if the checkbox was checked and null if it was not or an array of booleans.

Has anyone found a nice way to solve this little picadello

Regards Wendy

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Search Results Forms

Posted by Patrice <pp...@nerim.net>.
I think you can use the <html:multibox> tag.
If you have a property "myArray" in your ActionForm, corresponding to an
array of String:

<html:multibox property="myArray" value="0"/>
<html:multibox property="myArray" value="1"/>
<html:multibox property="myArray" value="2"/>
...

After submission, the array will contain only values corresponding to the
checked checkboxes ("1", "2"...).
The values corresponding to non-checked selectboxes will not appear.
Don't forget to setting the corresponding array to zero length in the
reset() method.

Hope it helps
Patrice

----- Original Message -----
From: "Wendy Cameron" <ca...@usq.edu.au>
To: "Struts Users Mailing List (E-mail)" <st...@jakarta.apache.org>
Sent: Monday, December 02, 2002 3:16 AM
Subject: Search Results Forms


> Has anyone come up with a good way to do checkbox form process with
Scrolling search results?
>
> Basically you have a list of search results each with a check box next to
it.  You also have scrolling pages, so you have Page 1 | 2 | 3 links etc.
>
> If you use the checkbox with the same name, this can be easily picked up
in your form bean etc, however if the user scrolls back and forth through
the result checking and unchecking items, this could lead to problems with
elements having been checked add, but later they were unchecked etc, and you
wouldnt know.
>
> I think you could possible work it by numbering the checkbox name.
However you lose your ability to automatically populate a form bean.
> Where the ideal situation is an array 0..n-1 where n is the length, with a
set of values, checked if the checkbox was checked and null if it was not or
an array of booleans.
>
> Has anyone found a nice way to solve this little picadello
>
> Regards Wendy
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>