I like to propose a new component for Myfaces - t:repeater. It will allow a
linear list of objects to be displayed in tabular form. The objects can be
arranged in horizontal orientation. i.e.

1  2  3
4  5  6
7  8  9

Or in vertical orientation, i.e.

1  4  7
2  5  8
3  6  9

This is a control available in ASP.NET that I find very handy.

It is a special case for t:columns, and I believe can be implemented on top
of t:columns quite easily.

Regards,
Yee

-----Original Message-----
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 3 November 2005 12:09 AM
To: MyFaces Discussion
Subject: Re: PanelGrid with dynamic amount of items

Instead of dataTable, have you considered using t:dataList with
layout=simple?   It's probably the best JSF replacement for c:forEach.

As for t:columns, consider it as a dataTable within a dataTable, only
the data is displayed horizontally rather than vertically.  
Internally, it's just a UIData component just like dataTable or
dataList.

-Mike

On 11/1/05, Sven Haiges <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I would like to render a panelGrid with an dynamic amount of items  in
> it. The items should be bound to a managed bean variable and based on
> the database result, the display should adapt.
>
> PanelGrid worked fine with a static number of items, but how can I add
> a dynamic number of items. I know there are problems with c:forEach,
> that's probably why the example of my code below also does not work....
>
>
> Any help is appreciated!
>
> (one sec: I just got the idea to add the components on the server side,
> ok, but isn't there an easy solution that i can just do in my jsp
> page?)
>
> Cheers,
> Sven
>
>         <h:panelGrid columns="4" frame="border">
>
>                 <c:forEach var='product'
items='#{productSearchBean.queryResults}'>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.orderNumber}"/>        <f:verbatim> - </f:verbatim>
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleEN}" rendered="#{view.locale.language
> eq 'en'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleDE}" rendered="#{view.locale.language
> eq 'de'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleFR}" rendered="#{view.locale.language
> eq 'fr'}" />
>                                 <h:outputText styleClass="contentRight"
> value="#{product.description.titleES}" rendered="#{view.locale.language
> eq 'es'}" />
>                 </c:forEach>
>
>         </h:panelGrid>
> ---
> Sven Haiges
> [EMAIL PROTECTED]
>
> TEL +49 89 420 958 993
> SIP [EMAIL PROTECTED]
> ---
> Sven Haiges
> [EMAIL PROTECTED]
>
> TEL +49 89 420 958 993
> SIP [EMAIL PROTECTED]
>

Reply via email to