简体   繁体   English

Richfaces:rich:使用rich:subtable的datatable rowspan

[英]Richfaces: rich:datatable rowspan using rich:subtable

I use Richfaces, Seam and JSF, and I want something like the following: 我使用Richfaces,Seam和JSF,我想要如下内容:

替代文字

and I have managed it to a degree using a rich:subtable like this: 并且我使用了一个富有的子程序来管理它:这样的子表:

<rich:dataTable
value="#{backingBean.companyList}"
rows="100"
var="company">
<f:facet name="header">
    <rich:columnGroup>
        <rich:column>Company Name</rich:column>
        <rich:column>Company Email</rich:column>
        <rich:column>Product Name</rich:column>
        <rich:column>Product Email</rich:column>
    </rich:columnGroup>
</f:facet>
<rich:subTable value="#{company.products}" var="product" rowKeyVar="rowKey">
    <rich:column rowspan="#{company.products.size()}" rendered="#{rowKey eq 0}">
        #{company.name}
    </rich:column>
    <rich:column rowspan="#{company.products.size()}" rendered="#{rowKey eq 0}">
        #{company.email}
    </rich:column>
    <rich:column>
        #{product.name}
    </rich:column>
    <rich:column>
        #{product.email}
    </rich:column>
</rich:subTable>

the problem is that companies that have NO products, do not get rendered at all. 问题是没有产品的公司根本没有得到渲染。 What I want would be for them to be rendered, and the remaining row (the product-specific columns) to be empty. 我想要的是渲染它们,剩下的行(特定于产品的列)是空的。

Is there a way to do this? 有没有办法做到这一点?

Note: I have also tried nested rich:datatables, but the internal columns do not overlap with the outer columns containing the header. 注意:我还尝试了嵌套的rich:datatables,但内部列与包含标题的外部列不重叠。 With rich:subtable the inner columns overlap with the outer columns and show nice. 使用rich:subtable,内部列与外部列重叠并显示不错。

UPDATE: 更新:

I created a Google Code project (a simple Maven project) that shows exactly what the problem is. 我创建了一个Google Code项目(一个简单的Maven项目),可以准确显示问题所在。

http://code.google.com/p/richfaces-rowspan/ http://code.google.com/p/richfaces-rowspan/

Follow-up discussion with answer (actually a Richfaces issue) in Richfaces forum. Richfaces论坛中的答案(实际上是Richfaces问题)的后续讨论。

http://community.jboss.org/message/541819#541819 http://community.jboss.org/message/541819#541819

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM