You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by PXZ <pr...@gmail.com> on 2011/06/03 01:47:41 UTC

Iterate over a panel

Hi, I have a list of products. I want each product to be rendered by a panel,
all on the same page.
So I would like to iterate over a panel. How can I do this?

--
View this message in context: http://click.1134972.n2.nabble.com/Iterate-over-a-panel-tp6433392p6433392.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Iterate over a panel

Posted by Bob Schellink <sa...@gmail.com>.
Hi,

I see two options:

If you want to use a Click component to iterate over your customers
create one in Java, and reference it in Velocity.

or

Create a Velocity macro with the common layout.

regards

Bob




On Fri, Jun 3, 2011 at 10:15 AM, PXZ <pr...@gmail.com> wrote:
> The examples I have seen so far, use a different approach:
>
> - http://click.avoka.com/click-examples/panel/panel-column-demo.htm uses a
> table to iterate over the panels. But I don't want to use tables.
> -
> http://click.avoka.com/click-examples/source-viewer.htm?filename=/panel/customersPanel3.htm
> (part of ListPanelDemo) uses #foreach, but no Click Panel objects are used
> to define common layout.
>
> I'm looking for something like this:
>
> #foreach( $customer in $customers )
>  $customerPanel($customer)
> #end
>
> where "customerPanel" is a Click component that receives a customer to
> render.
> Or an approach like this:
> $customers
>
> Where "$customers" is a Click component that iterates over Click customer
> panel components.
>
> --
> View this message in context: http://click.1134972.n2.nabble.com/Iterate-over-a-panel-tp6433392p6434426.html
> Sent from the click-user mailing list archive at Nabble.com.
>

Re: Iterate over a panel

Posted by PXZ <pr...@gmail.com>.
The examples I have seen so far, use a different approach:

- http://click.avoka.com/click-examples/panel/panel-column-demo.htm uses a
table to iterate over the panels. But I don't want to use tables.
-
http://click.avoka.com/click-examples/source-viewer.htm?filename=/panel/customersPanel3.htm
(part of ListPanelDemo) uses #foreach, but no Click Panel objects are used
to define common layout.

I'm looking for something like this:

#foreach( $customer in $customers )
  $customerPanel($customer)
#end

where "customerPanel" is a Click component that receives a customer to
render.
Or an approach like this:
$customers

Where "$customers" is a Click component that iterates over Click customer
panel components.

--
View this message in context: http://click.1134972.n2.nabble.com/Iterate-over-a-panel-tp6433392p6434426.html
Sent from the click-user mailing list archive at Nabble.com.

Re: Iterate over a panel

Posted by tomasz bandura <to...@gmail.com>.
I am not sure what would you like to do exactly but please check
examples listed below:

http://click.avoka.com/click-examples/panel/list-panel-demo.htm
http://click.avoka.com/click-examples/panel/panel-column-demo.htm

t.

2011/6/3 PXZ <pr...@gmail.com>:
> Hi, I have a list of products. I want each product to be rendered by a panel,
> all on the same page.
> So I would like to iterate over a panel. How can I do this?
>
> --
> View this message in context: http://click.1134972.n2.nabble.com/Iterate-over-a-panel-tp6433392p6433392.html
> Sent from the click-user mailing list archive at Nabble.com.
>