-
1. Re: how to create dynamic count of columns in a datatable
ilya_shaikovsky Apr 6, 2007 8:52 AM (in response to kazoo)Try to use nested a4j:repeats.
-
2. Re: how to create dynamic count of columns in a datatable
kazoo Apr 6, 2007 4:40 PM (in response to kazoo)I will try that. Do you have any sample code ?
-
3. Re: how to create dynamic count of columns in a datatable
kazoo Apr 23, 2007 12:38 PM (in response to kazoo)I tried the following, it won't display anything.
<rich:dataTable ..> <f:facet name="header"> <rich:columnGroup> <a4j:repeat value="#{aList}" var="aVendor"> <h:column> <h:outputText value="#{aVendor.name}"/> </h:column> </a4j:repeat>
-
4. Re: how to create dynamic count of columns in a datatable
sergeysmirnov Apr 23, 2007 5:58 PM (in response to kazoo)if you use facelets, you can try forEach.
Your attempt is similar to the one mentioned in another post. See my explanation there why it would not work.
http://jboss.com/index.html?module=bb&op=viewtopic&t=106113 -
5. Re: how to create dynamic count of columns in a datatable
-arthur- Apr 24, 2007 3:29 AM (in response to kazoo)If you're using myfaces give "t:columns" a try. For me its working good.
In correlation you should take a look on the javax.faces.model.DataModel Datastructure.
Here's my jsf code I'm using:<t:dataTable value="#{absencePage.calendar.dataModelDates}" var="date" styleClass="holidaytable"> <t:column> <f:facet name="header"> <h:outputText value="Date" /> </f:facet> <h:outputText value="#{date}" styleClass="datecell"> <f:convertDateTime dateStyle="short" timeZone="CET" /> </h:outputText> </t:column> <t:columns value="#{absencePage.calendar.dataModelHeaders}" var="column"> <f:facet name="header"> <h:panelGrid columns="1"> <h:outputText value="#{column.fullName}" styleClass="employees" /> </h:panelGrid> </f:facet> <h:outputText styleClass="#{absencePage.calendar.element.cssKey}" value=" " /> </t:columns> </t:dataTable>
-
6. Re: how to create dynamic count of columns in a datatable
kazoo May 9, 2007 11:59 AM (in response to kazoo)I tried the c:foreach tag in richtable and richColumnGroup, it works well for fancy headers. The problem is the data binding. When it binds, it will iterate correct number of times of the loop, but only bind the data from the first column of the loop.
Ex. I have 3 vendors to loop through, it loops 3 times, but only binds the data with the 1st vendor.
<c:forEach var="pricing" items="#{vendorPricing.compareVendors}"
begin="0" step="1">
<rich:column>
<h:inputText value="#{pricing.formula}"/>
</rich:column>
<rich:column>
<h:inputText value="#{pricing.cost}"/>
</rich:column>
<rich:column>
<h:inputText value="#{pricing.extendedCost}" />
</rich:column>
</c:forEach>