p:ajax更新了多个元素

p:ajax更新了多个元素,ajax,jsf,primefaces,Ajax,Jsf,Primefaces,我在尝试更新两个元素时遇到问题 这是我的代码: <h:form id="all"> <table id="gt" class="CartContents Stylize General" cellspacing="0" cellpadding="0" style="display:#{clothesBean_i.convertToList(clothesBean_i.cartclothes)}"> <tbody>

我在尝试更新两个元素时遇到问题

这是我的代码:

<h:form id="all">
        <table id="gt" class="CartContents Stylize General" cellspacing="0" cellpadding="0" style="display:#{clothesBean_i.convertToList(clothesBean_i.cartclothes)}">


            <tbody>


<!--                AFFICHAGE PRODUIT -->
<ui:repeat   value="#{clothesBean_i.convertToList(clothesBean_i.cartclothes)}" var="c">
<tr>
    <td class="CartThumb" style="">
        <a href="http://outdoor-adventures-demo.mybigcommerce.com/foam-rollup-mat/"><img src="" /></a>&#160;
    </td>
    <td class="ProductName" colspan="1">
        <h5><a href=""></a></h5>
        <br />

    </td>

    <td align="center" class="CartItemIndividualPrice">
         $ #{c.price}
    </td>
    <td  id="qt" align="center" class="CartItemIndividualPrice">
    <h:outputLabel for="ajaxSpinner" value="" />
    <p:outputPanel id="mypanel">
        <p:spinner   id="ajaxSpinner" value="#{clothesBean_i.qt}" min="1" max="100">
            <p:ajax update="tot grandT" process="@this" />
        </p:spinner>
    </p:outputPanel>
    </td>

    <td  align="center" class="CartItemIndividualPrice">

    <h:outputText id="tot" value="$ #{clothesBean_i.getClothePriceQt(c)}" />

    </td>

</tr>
</ui:repeat>
            </tbody>
        <tfoot >

                <tr  class="SubTotal GrandTotal">
                    <td colspan="4">Grand Total:</td>
                    <td >
                    <h:outputText id="grandT" value="$ #{clothesBean_i.getClothesPrice(clothesBean_i.convertToList(clothesBean_i.cartclothes))}" />
                    </td>
                </tr>

            </tfoot>

        </table>
    </h:form>

 

$#{c.price} 总计:
在这一行

<p:ajax update="tot grandT" process="@this" />

当我只给出一个id(
tot
grandT
)时,它工作正常,
但是有了两个ID,我就得到了一个空白页(没有显示任何内容)

在ID之间加逗号,并以冒号->开头提供它们的绝对路径,但除此之外,我认为您在使用组件方面存在错误,特别是在表达式语言和视图级别过度使用业务逻辑方面。您可能需要重新考虑您的设计阿尔卑斯山A.15分钟前您需要使用process=“@form”而不是process=“@this”来处理ajax标记中的表单元素。服务器/应用程序日志中有错误吗?请编辑您的问题,代码缺失/不可见。我认为您的问题是因为“tot”组件是内部ui:重复,在这种情况下,将为每个repeat创建一个命名容器,以避免重复ID,但grandT不在ui:repeat范围内,因此它们具有不同的命名上下文前缀。可能的primefaces尝试将相同的前缀附加到两个相对ID。请检查并编写此ajax调用的请求参数。