Re: Handling DataObjects

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Dec 01 2004 - 10:15:46 EST

  • Next message: Andrus Adamchik: "Re: Problem commiting objects"

    =?ISO-8859-1?Q?Jo=E3o_Paulo_Vasconcellos?= <vasconcello..mail.com> wrote:
    > I am writing an application which lets people changes their data. I
    > got a field named Marital Status and I need to show a list of the
    > possible status. All fine until there. The problem is, how do I
    > retrieve this info from the form? When the user changes their marital
    > status using the <select> provided, how can I know which status she
    > picked up whithout using the object's PK, as this is bad design?

    Create a list (or array) of select options (which is probably what you're
    doing now).

    Instead of the primary key, use the index into the list (or array). In the
    sample code you posted, this would be "i"

    In your processing code, just make sure that "i" is a valid index into the
    collection, and then retrieve the object from the list/array.

    -Mike



    This archive was generated by hypermail 2.0.0 : Wed Dec 01 2004 - 10:14:05 EST