【问题标题】:Header doesn't appear in PrimeFaces p:column, when in composite component在复合组件中时,标题不会出现在 PrimeFaces p:column 中
【发布时间】:2012-08-03 17:03:22
【问题描述】:

我尝试将复合组件作为 Primefaces p:column: /resources/ezcomp/columnBd_1.xhtml:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=   "http://www.w3.org/1999/xhtml"
      xmlns:h= "http://java.sun.com/jsf/html"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:p= "http://primefaces.org/ui">

    <!-- INTERFACE -->
    <cc:interface componentType="org.primefaces.component.Column" preferred="true" shortDescription="Extended Datatable">
        <cc:attribute name="header"/>
        <cc:attribute name="value"/>
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>
        <cc:actionSource name="#{component}">
            <p:column headerText="#{cc.attrs.header}">
                <h:outputText value="#{cc.attrs.value}"/>
            </p:column> 
        </cc:actionSource>

    </cc:implementation>
</html>

当我在 p:dataTable: 中使用它时:

<ez:columnBd_1 header="#{msg.colPriceCloseBid}" value="#{row.closeBid}"/>

我有一列填充了值,但没有标题文本。 除了使用标签文件有什么建议吗?

【问题讨论】:

    标签: primefaces composite-component


    【解决方案1】:

    尝试使用 outputText 组件来声明标题方面。

    <p:column>
      <f:facet name="header">
        <h:outputText value="#{cc.attrs.header}" />
      </f:facet>
    </p:column>
    

    【讨论】:

    • 我试过这个。不幸的是效果是一样的 - 没有出现标题。
    猜你喜欢
    • 2013-12-16
    • 2014-05-21
    • 1970-01-01
    • 2013-03-07
    • 1970-01-01
    • 1970-01-01
    • 2012-10-08
    • 1970-01-01
    • 2016-04-20
    相关资源
    最近更新 更多