[Opensource] multi-valued fields towards multiple select boxes

Michael Rimov rimovm at centercomp.com
Thu Mar 20 14:10:05 PST 2003


At 10:52 AM 3/20/2003 -0500, you wrote:
>Expreso provides for automatically generating a HTML FORM FIELD, that would
>correspond to a DBObject FIELD, and be used to update the field value.
>A typical example is the generation of HTML forms for Registration Objects.
>
>I need that one field of my registration information be a multiple choice
>MenuBox.
>In DBObject terms this would mean that I need a multi-valued field, whose 
>value
>be A SET of some of those valid values.
>DBObject multi-valued fields go fine with html MenuBoxes that allow only a
>single choice (multiple=false), but how about the multiple choices ?
>So my question is :
>1 - Does Expresso have any support for this kind of field. (I looked a bit
>through the source code and could not find any clue).
>2 - If not, has anyone used any work around to this.

Lirian,

Multiple selects in menu boxes are, indeed, not directly 
supported.  Multiple checkboxes can be supported by giving each checkbox a 
unique ID number... I've done it that way in a couple of projects, and 
although the jsp is a little weird it makes the code on the expresso side 
much easier.

To deal with multiple selections of the same name, you'll need to downcast 
ControllerRequest to ServletControllerRequest so you can get a List of all 
parameters, not just a Map of them.

HTH!
                                                 -Mike





More information about the Opensource mailing list