【问题标题】:Primefaces datatable is not showing one column header after ajax (the column rows ares showed)Primefaces数据表在ajax之后没有显示一个列标题(显示列行)
【发布时间】:2013-07-12 02:02:57
【问题描述】:

数据表显示此列(和其他):

<p:column id="columnId" headerText="#{bundle.headerColumn}"
                              rendered="#{item.condition()}" >
    <p:cellEditor id="cellEditId">  
        <f:facet name="output"  >
              ...
        </f:facet>
        <f:facet name="input">
              ...
        </f:facet>
    </p:cellEditor>
</p:column>

ajax更新数据表:

<p:ajax event="cellEdit" listener="#{controller.onCellEdit}" 
                        update="dataTableId" />

但是 ajax 更新后该列的列标题不显示。 列行和页脚显示正常,右侧列标题向左移动一列。

在ajax之前,渲染的html是:

<span><span>Header Text</span></span></th>

但是ajax更新后的代码是:

<span>Header Text</span></th>

其他列没问题,但没有渲染属性。

【问题讨论】:

  • 附加信息:当我移除渲染条件后,问题就解决了。

标签: primefaces datatable rendered-attribute


【解决方案1】:

把它放在你的数据表中:

<p:columnGroup type="header">  
                                <p:row>
                                    <p:column headerText="Select" />  
                                    <p:column headerText="Name activity" />  
                                    <p:column headerText="View activity" />  
                                    <p:column headerText="Consistency and completeness" />  
                                </p:row>
                            </p:columnGroup>

这是您表格的标题...在放置您的列之后。

这里有一个例子:http://www.primefaces.org/showcase/ui/datatableGrouping.jsf

作者。

【讨论】:

    猜你喜欢
    • 2015-12-23
    • 2015-01-04
    • 1970-01-01
    • 2011-12-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-11
    • 2015-09-29
    • 1970-01-01
    相关资源
    最近更新 更多