我尝试将复合组件制作为 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}"/>
我有一列填充了值,但没有标题文本。除了使用标签文件有什么建议吗?