You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Howard M. Lewis Ship" <hl...@attbi.com> on 2003/02/20 00:08:33 UTC
RE: [Tapestry-developer] A Form with many Checkboxes
The Checkbox component provided with Tapestry is used to set a boolean
property.
You may need to create your own Checkbox.
In fact, what you are suggesting sounds much more like Radio and RadioGroup.
In those, the RadioGroup identifies which property will be read or set, and
each Radio provides a value when that is the selected item. You can check
out the source code and take this basic idea and extend it to handle
multiple selection.
If all of these checkboxes are grouped together in a single place, you may
be able to use the Palette component, which is a powerful multiple selection
componenent (even allows ordering!).
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry
> -----Original Message-----
> From: tapestry-developer-admin@lists.sourceforge.net
> [mailto:tapestry-developer-admin@lists.sourceforge.net] On
> Behalf Of Meade, Joseph L
> Sent: Wednesday, February 19, 2003 12:25 PM
> To: Tapestry-Developer (E-mail)
> Subject: [Tapestry-developer] A Form with many Checkboxes
>
>
> Tapestry Gurus,
>
> I need some help with the paradigm shift.
>
> I've got a form with an arbitrary number of related
> checkboxes. The value of each is an int corresponding to a
> String label. (illnessName and illnessID)
>
> In the servlet paradigm, I would name them all the same thing
> and call something like this in the form listener: String[]
> illnessIDs = request.getParameterValues("illness");
>
> But, it seems in Tapestry that you need a specific boolean
> attribute for each checkbox? That's tough when you don't
> know how many you will have or what they will be called.
>
> What am I missing? How can I receive a collection of values
> corresponding to the checked boxes? I know the Checkbox
> component accepts informal parameters, so I have set a value
> for each, but I can't see how to retrieve it once the form is
> submitted.
>
> Thanks for your help.
>
>
>
> Joe Meade
> joemeade@virginia.edu
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SlickEdit Inc. Develop an
> edge. The most comprehensive and flexible code editor you can
> use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE
> 30-Day Trial. www.slickedit.com/sourceforge
> _______________________________________________
> Tapestry-developer mailing list
> Tapestry-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tapestry-developer
>