It sounds like you are using a different ArrayList for each of the
different things you are trying to display. You might be able to get
this to work, but the easiest way would be to put them all in a single
object and then have your ArrayList hold a collection of these
objects.
In your Page .java file you'll have something like:
@Property
private ArrayList<Item> itemList; //make sure this gets initialized somewhere
@Property
private Item item
Then your template file should contain something like:
<t:loop source="itemList" value="item">
${item.name}
${item.rating}
<img src="${item.imageSrc}"/>
</t:loop>
When the loop is rendered it will set the value of the item property
to the first item it gets from itemList and then render the loop
contents. Then it will set the value of the item property to the next
value it gets from itemList, render the loop body, etc. until it runs
out of items in itemList.
Mark
On Sun, Jan 23, 2011 at 3:16 PM, sarov saravanan <[email protected]> wrote:
> Hi,
> I am new to tapestry, I have a use case like creating a page which should
> generate list of items with image, detail of item and rating of item.
>
> I am just trying this with ArrayList for images, item and rating. I am trying
> to use LOOP
> component which could iterate the list of each item with image, detail and
> rate.
>
> Is there any nice way I can do this ? since I need to Play around with Loop
> and other
> component which can full fill this use case.
>
> Any help or suggestion is appreciated!
>
> Thanks!
>
> with regards,
> Saravanan.N
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]