This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSF and the fly likes dataTable with dynamic number of rows and columns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable with dynamic number of rows and columns" Watch "dataTable with dynamic number of rows and columns" New topic
Author

dataTable with dynamic number of rows and columns

Tejram Meena
Greenhorn

Joined: Sep 16, 2007
Posts: 2
I need to create a dataTable with variable number of columns, and it would also have variable number of rows.

-----------------------------------
| Yields |
-----------------------------------
TrancID | 14 | 15 | 16 | 17 | 18 |
-----------------------------------
T1 | P1 | P2 | P3 | P4 | P5 |
-----------------------------------
T2 | p1 | p2 | p3 | p4 | p5 |
-----------------------------------

I have TrancID in a list and i iterate it using the datatable iterator. I iterate yields using seam:repeat iterator.

dataTable code in xhtml file:
<rich:dataTable id="TranchvsYield" var="deal" value="#{pricingResultTab1.tranches}">
<f:facet name="header">
<rich:columnGroup>
<rich:column>
<hutputText value="Tranche"></hutputText>
<ui:repeat value="#{pricingResultTab1.yields}" var="fan">
<rich:column style="text-align:center">
<hutputText value="#{fan}" />
</rich:column>
</ui:repeat>
</rich:column>
</rich:columnGroup>
</f:facet>
<rich:columnGroup>
<rich:column >
<hutputText value="#{deal}" id="trancheId1"></hutputText>
<ui:repeat value="#{pricingResultTab1.prices}" var="task">
<rich:column style="text-align:center">
<hutputText value="#{task}" />
</rich:column>
</ui:repeat>
</rich:column>
</rich:columnGroup>
</rich:dataTable>

Here PricingResultTab1 is the bcking entity beans. tranches and yields are lists having T1, T2... and 14, 15, 16... respectively.
The number of rows and columns works fine , but i don't know who to get the prices right, ..p1, p2, p3..

As from the code prices in each row would be same as in first row..

Help needed..

Thanks in advance.
Tejram Meena
Greenhorn

Joined: Sep 16, 2007
Posts: 2
Can anyone help me..

Thanks
Earnest Dyke
Greenhorn

Joined: Oct 10, 2007
Posts: 1
Tejram,

Did you find a way to do this? I have a way that might work for you.

Earnie!


Earnest Dyke
Paterne Gaye-Guingnido
Greenhorn

Joined: Jun 17, 2008
Posts: 5
Earnest ,
I have the same problem and what I'm doing now is to use the html TABLE and a4j repeat



What about your solution?

Thanks for your help.

Paterne Gaye-Guingnido
Greenhorn

Joined: Jun 17, 2008
Posts: 5
I have this problem

With open office 2.4

when i store a generate odt file with this command
i have this bug :

com.sun.star.task.ErrorCodeIOException:
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:275)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:141)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:377)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:346)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:106)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:860)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:809)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:159)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:141)
at $Proxy116.storeAsURL(Unknown Source)


Some one can help me
 
Consider Paul's rocket mass heater.
 
subject: dataTable with dynamic number of rows and columns