我想要做的是声明一个通用的数据表头作为一个复合组件。但这个答案让我直,因为它并没有呈现:自定义taglib结果MethodNotFoundException
How to create a composite component for a datatable column?
基本上它指示我尽我自己的taglib这个作品真的很好,除了我的头有它,做重新解析链接。当按下此链接时,会抛出MethodNotFoundException。
这是我的自定义标签库:
<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
version="2.0">
<namespace>http://stackoverflowdummy.com/dumb/components</namespace>
<tag>
<tag-name>tableHeader</tag-name>
<source>tags/tableHeader.xhtml</source>
<attribute>
<description></description>
<name>value</name>
</attribute>
<attribute>
<description>The listener that handles sorting</description>
<name>sortAction</name>
<method-signature>java.lang.String action()</method-signature>
</attribute>
<attribute>
<description>The property that holds the current id to sort on
</description>
<name>sortValue</name>
</attribute>
<attribute>
<description>The component that needs to be updated after changes
</description>
<name>reRender</name>
</attribute>
</tag>
</facelet-taglib>
我尝试没有方法签名,我也试图消除“行动”。我的web.xml中不包括像这样的taglib:
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/cc.taglib.xml</param-value>
</context-param>
我也试图与“facelets.LIBRARIES”,但它并没有区别。
<h:commandLink value="#{o.label}" action="#{sortAction}" immediate="true" reRender="#{reRender}">
<f:setPropertyActionListener target="#{sortValue}" value="#{o.column.sortId}" />
</h:commandLink>
结束使用的定义如下:
sortAction="#{myBean.sort}"
即豆有一个称为与签名字符串方法排序();如果我只是定义它并跳过使用我自己的标签,它的工作非常好。但是,除了动作方法外,所有内容都可以与标签一起工作...
http://showcase.omnifaces.org/taghandlers/methodParam – BalusC
DONO为什么有人未添加追随者标签,另一个更多的是JSF 1.2 Facelets的库,但无论;) –