在复合组件中,标题不会出现在PrimeFaces p:列中

时间:2012-08-03 17:03:22

标签: primefaces composite-component

我尝试将复合组件制作为Primefaces p:列: /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}"/>

我的列中填充了值,但没有标题文本。 除了使用标签文件以外的任何建议吗?

1 个答案:

答案 0 :(得分:0)

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

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