cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Jarrel <>
Subject Re: Decoaring ToManyList
Date Fri, 30 Jul 2010 08:08:12 GMT
On Fri, Jul 30, 2010 at 5:08 PM, Andrus Adamchik <> 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

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.


View raw message