无法将方法传递给自定义组件jsf 1.2

时间:2015-04-14 05:49:55

标签: jsf jsf-1.2 tomahawk

我尝试将动作侦听器添加到我的自定义组件中。

我有自定义数据表,它包含tomahawk数据表。 我有自定义dataScroller包装tomahawk datascroller。 我需要传入datatable中定义的dataScroller方法。

<custom:dataScroller actionListener="#{someBean['someMethod']}"...

 <custom:dataScroller actionListener="#{someBean.someMethod}"...

在taglib文件中:

    <tag>
        <name>dataScroller</name>
        <tag-class>java.lang.Object</tag-class>
        <body-content>scriptless</body-content>
     ...
        <attribute>
            <name>actionListener</name>
            <deferred-method>
                <method-signature>
                    void myMethod(javax.faces.event.ActionEvent )
                </method-signature>
            </deferred-method>
        </attribute>
     ...
    </tag>

in dataScroller.xhtml

<t:dataScroller id="scroller_#{for}" for="#{for}" 
                fastStep="#{fastStep}"   
                paginatorRenderLinkForActive="false"
                paginator="true" 
                paginatorMaxPages="10" 
                paginatorActiveColumnStyle="font-weight:bold;"
                renderFacetsIfSinglePage="#{allwaysRender}"
                binding="#{applicationBean.scroll}"
                actionListener="#{actionListener}"// HERE is the actionListener
                immediate="false">

这给了我 javax.faces.el.EvaluationException: ... Property 'someMethod' not found on type ......

它将方法标记为属性,但应将其标记为方法

public void someMethod(ActionEvent sae) {
    LOGGER.info("Event: #0" + sae.getClass().toString());
}

问题应该在哪里?

0 个答案:

没有答案