[Seaside] Multiple copies of the same component on a page
pdebruic at gmail.com
Mon May 11 17:33:03 UTC 2009
I have a component that I would like to render a variable number of
times on a page with slightly different contents each time it is
rendered. I have an ordered collection that contains the different
content for each instance of the component. An example of what I'd like
to do is the following:
I have a set of clients. Each client has a different set of assets in
their portfolio, and has a different number of assets in their
portfolio. On one page, I'd like to display a price graph for each of
the assets in the portfolio for the time the client has held the asset.
Since the timespan that the assets have been held will be different
for each client, the graphs should be independent. My component will
get the time series of prices and plot it for an asset for the
appropriate time period.
What I have tried is this:
aPortfolio do: [:each | plot := PDAssetGraph new asset: each.].
PDAssetGraph's renderContentOn: method coordinates the collection and
ploting of the data. But my use of do: above just leaves me with a graph
of the last asset in the collection on my page. How can I display and
keep all the intermediate graphs? It seems to be pulling the data in
for them and is probably preparing the graphs as well, but only
rendering the last one.
Thanks for any guidance you can provide.
More information about the seaside