Primefaces对要显示在页脚中的特定列求和

Primefaces对要显示在页脚中的特定列求和,primefaces,datatable,Primefaces,Datatable,我在我的应用程序中使用PrimeFaces 6.0。我使用我的一个页面,如bank challan。如果用户具有计算金额和总金额的类型count <p:column headerText="Denomination"> <h:outputText value="#{bank.denominationAmt}"/> </p:column> <p:column headerText="Count"> <p:inputText value="#{b

我在我的应用程序中使用PrimeFaces 6.0。我使用我的一个页面,如bank challan。如果用户具有计算金额和总金额的类型count

<p:column headerText="Denomination">
<h:outputText value="#{bank.denominationAmt}"/>
</p:column>
<p:column headerText="Count">
<p:inputText value="#{bank.count}"/>
</p:column>
<p:column headerText="Amount">
<p:inputText value="#{bank.amt}"/>
</p:column>
....

....

我需要在javascript或primefaces中输入count或amount以显示页脚文本中显示的金额总和?

您必须在托管bean中计算总数,然后在页脚中添加一个
列组来显示:

<p:columnGroup type="footer">
    <p:row>
        <p:column style="text-align:right" footerText="Totals:" />
        <p:column style="text-align:right" footerText="#{managedBean.amount}" />
         ...
         ...
    </p:row>
</p:columnGroup>

...
...

您需要在amount inputtext中设置带有更改事件的
p:ajax
,以重新计算金额总和并更新总计列。

我需要在count或amount文本框中按键,以计算金额总和列,并在页脚文本中显示。可以在Primefaces组件或Javascript@BillyHope我尝试了你的解决方案,结果成功了工作完美datatables标记完全错误。PrimeFaces数据表不基于jquery数据表。