[Opensource] multi-valued fields towards
multipleselectboxes
larry hamel
expresso at codeguild.com
Tue Mar 25 00:49:28 PST 2003
is there a nice way to generalize a solution? like all nice-to-have features, if you figure out a way to make it work for your app, and that way would work for others, consider contributing it back to the library.
larry
At 07:26 AM 3/24/2003, you wrote:
>Hi Larry,
>
>This question is not simply my personal concern, as I can fix it in a customized (my own) way.
>The point is that I think that this deserves to be an Expresso issue, which means that we ought to find an optimal and reusable solution.
>
>Again, in practical terms, an example of when the problem rises is:
>
>If users have to have some registration information that is expressed through a multiple choice box, we CAN NOT use an Epresso RegistrationDBObject to save this user registration information in the database.
>As consequence the whole Expresso's user administration support becomes obsolete.
>
>As I explained previously, going deeper, I do not see this as an RegistrationDBObject issue, but I see it as a DBObject issue, because the there can be other cases in which one would like to automatically
>map an HTML FORM to the database and vice versa.
>
>As I said before the automatic mapping HTML FORM - DBObject already exists in Expresso and it is nicely used in the case of RegistrationDBObjects, but it falls short if the Html Form contains one ore more
>multiple choice boxes.
>
>Thank you
>
>Lirian
>
>
>
>larry hamel wrote:
>
>> perhaps I don't understand the question, but consider an association table
>>
>> definition_table # this defines the pull down list
>> poss_values
>>
>> association_table
>> user_id
>> chosen_value # foreign key on poss_values
>>
>> so long as there is no unique key which includes both these fields in in association table, multiple rows can be written for the same user_id (it can be other than user_id--whatever association you need)
>>
>> you mentioned "multi-valued" dbobjects, but have you seen MultiDBObject.java? it may apply here.
>>
>> larry
>>
>> At 06:27 AM 3/21/2003, you wrote:
>> >Hi Dave and Mike,
>> >Thanks for the quick answers.
>> >Back to the same issue, my concern is in fact on the persistence layer (I have
>> >already resolved on my own way the presentation and the form data collection,
>> >much like you guys did)
>> >
>> >My question is :
>> >How do I store into database the field values coming from a multiple select
>> >MenuBox.
>> >What kind of DBObject field would be able to do that ?
>> >
>> >In other words :
>> >A DBObject record (or instance) can be presented in a HTML FORM, but the way
>> >around is not always possible.
>> >If the html form contains a multiple select box or a group of checkboxes, I can
>> >not represent it as a DBObject field.
>> >
>> >In my practical case, I have some Registration Info for my users that consist of
>> >multiple selection, and I can not use the
>> >Expresso Registration Object for them.
>> >
>> >My first thoughts have been about either playing with a regular DBObject field,
>> >whose value will be a delimiter separated string of the selected values, or
>> >playing with the multi-valued DBObject fields.
>> >
>> >looking forward to any idea or opinion
>> >
>> >Lirian
>> >
>> >
>> >
>> >Michael Rimov wrote:
>> >
>> >> 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
>> >>
>> >> _______________________________________________
>> >> Opensource mailing list
>> >> Opensource at jcorporate.com
>> >> http://mail.jcorporate.com/mailman/listinfo/opensource
>> >> Archives: http://mail.jcorporate.com/pipermail/opensource/
>> >
>> >_______________________________________________
>> >Opensource mailing list
>> >Opensource at jcorporate.com
>> >http://mail.jcorporate.com/mailman/listinfo/opensource
>> >Archives: http://mail.jcorporate.com/pipermail/opensource/
>>
>> _______________________________________________
>> Opensource mailing list
>> Opensource at jcorporate.com
>> http://mail.jcorporate.com/mailman/listinfo/opensource
>> Archives: http://mail.jcorporate.com/pipermail/opensource/
>
>_______________________________________________
>Opensource mailing list
>Opensource at jcorporate.com
>http://mail.jcorporate.com/mailman/listinfo/opensource
>Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list