<p:dataTable id="tableContas" value="#{extratoBancoController.contas}" var="entity" editable="true">
<f:facet name="header">
<h:outputText value="Contas" />
</f:facet>
<p:ajax event="rowEdit" listener="#{extratoBancoController.calcularValores()}" update=":mainForm:relatorios" process=":mainForm:relatorios" /> <!-- I tried with, and without process tag. Result is the same-->
<p:column style="width:80px">
<f:facet name="header">
<h:outputText value="#{msg['entity.id']}" />
</f:facet>
<h:outputText value="#{entity.id}" />
</p:column>
<!-- Other columns here -->
<p:column sortBy="#{entity.valor}" headerText="#{msg['entity.valor']} (R$)">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{entity.valor}" style="float: right; padding-right: 50%;"/>
</f:facet>
<f:facet name="input">
<po:inputDinheiro id="inputValor" required="true" fieldId="valor" targetValue="#{entity.valor}" />
</f:facet>
</p:cellEditor>
</p:column>
<p:column>
<p:rowEditor />
</p:column>
<p:column>
<p:commandButton icon="ui-icon-minus" actionListener="#{extratoBancoController.calcularValores()}" update=":mainForm:relatorios" process=":mainForm:relatorios">
<p:collector value="#{entity}" removeFrom="#{extratoBancoController.contas}" />
</p:commandButton>
</p:column>
<f:facet name="footer">
<h:outputText
value="Total Entrada: R$ #{extratoBancoController.totalEntrada}" />
<h:outputText value=" - " />
<h:outputText
value="Total Saida: R$ #{extratoBancoController.totalSaida}" />
</f:facet>
</p:dataTable>
那么,发生了什么:
第 1 步:在 0 方位的情况如何
第2步:让我们点击铅笔图标,更改值并检查它!:)
结果:在 ajax 之后,数据表布局发生了这样的事情:
PS:值按预期更新,只是布局中断!:(