0

我正在尝试将复合组件绑定到 ajax 侦听器,但绑定变量解析为 null。如果我使用绑定变量作为主体的一部分,例如。#{bind}它确实可以正确解决。我认为这是一个错误,但在我报告它之前想要第二个意见。谢谢

页:

 <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:composite="http://xmlns.jcp.org/jsf/composite"
        xmlns:jstl="http://xmlns.jcp.org/jsp/jstl/core"
        xmlns:jfunc="http://xmlns.jcp.org/jsp/jstl/functions"
        xmlns:jid1="http://mydomain.com/facelets">

<h:head></h:head>
<h:body>
    <h:form id="commentBoxForm">
        <jid1:confirmModal title="t" cssID="a" binding="#{bind}">
            </jid1:confirmModal>

            <h:commandLink value="click">
                <f:ajax execute="@this" render="@form"
                    listener="#{bind.getFamily()}" />
            </h:commandLink>
    </h:form>
</h:body>
</html>

零件:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://xmlns.jcp.org/jsf/core"
        xmlns:h="http://xmlns.jcp.org/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
        xmlns:composite="http://xmlns.jcp.org/jsf/composite"
        xmlns:jstl="http://xmlns.jcp.org/jsp/jstl/core"
        xmlns:jfunc="http://xmlns.jcp.org/jsp/jstl/functions"
        xmlns:jid1="http://mydomain.com/facelets">

        <composite:interface>
            <composite:attribute name="cssID" required="true" />
            <composite:attribute name="title" required="true" />
        </composite:interface>

        <composite:implementation>

            <h:panelGroup >
                ......
            </h:panelGroup>

        </composite:implementation>
    </ui:composition>
4

1 回答 1

0

这是一个错误。有关详细信息,请参见此处

对于 Ajax 调用,复合组件binding属性将无法正常工作。

于 2013-07-11T15:24:56.010 回答