Re: Decoaring ToManyList

From: Gary Jarrel (garyjarre..mail.com)
Date: Fri Jul 30 2010 - 08:08:12 UTC

  • Next message: Gary Jarrel: "Exception when deleting in prePersist"

    On Fri, Jul 30, 2010 at 5:08 PM, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > Hi Gary,
    >
    > So what is the function of a decorator list in this case?
    >

    I'd like to be able to add a number of items to a relationship via a
    web framework such as Struts2. I have an arbitrary number of products
    that can form part of the campaign. Each is represented by a field
    within the form. When Struts2 submits the form it basically calls:
    campaign.getProducts().get(0).setName("Product 1"),
    campaign.getProducts().get(1).setName("Product 2") and so on and so
    forth.

    I can not for tell the number of products that will form part of the
    campaign as the form is modified dynamically by jQuery in the browser.

    So when a new campaign object is being created the list returned for
    getProducts is empty so naturally it needs to grow as the submitted
    parameters are processed, and since struts does not seem to use a
    getProducts.add method but accesses the list by indexes, I though
    perhaps using a LazyList.

    I know that this example is convoluted I am unfortunately working with
    somebody else code on the front end.

    Gary



    This archive was generated by hypermail 2.0.0 : Fri Jul 30 2010 - 08:08:43 UTC