JSF Primefaces:如何将ID从一个页面引用到另一个页面?

时间:2016-07-18 12:06:28

标签: ajax primefaces jsf-2.2

在您将此标记为重复之前,我会阅读BalusC发布的this帖子,但我找不到答案。我也试过p:component()来引用我的组件。

我的用例非常简单:

一个页面上的commandButton应该更新另一个页面上的dataTable。

我的来电者页面:

<h:body>
    <h:form id="sendtxform">
                <h:commandButton id="sendtx" value="Send">
            <f:ajax listener='#{transactionXmlController.sendTx()}'
                render=":alltxform:tablealltx"/>
        </h:commandButton>
    </h:form>
</h:body>

我的被叫页面:

<h:body>

<!-- Fill the table before rendering -->
<f:event type="preRenderView" listener="#{transactionListController.findAllTx()}" />

    <h:form id="alltxform">
        <p:dataTable id="tablealltx" var="transaction"
            value="#{transactionListModel.txList}" paginator="true" rows="30">
            <!-- content -->
        </p:dataTable>
    </h:form>
</h:body>
</html>

我收到此错误:

包含一个未知的id':alltxform:tablealltx' - 无法在组件sendtx的上下文中找到它

我如何引用我的tablealltx?我尝试使用和不使用标题冒号,并使用p:component('tablealltx')我做错了什么?

0 个答案:

没有答案