Ich habe eine einfache Primefaces Datatable mit einer SummaryRow. Die Werte dieses SummaryRow werden in der ManagedBean berechnet und sind in einfachen BigDecimal-Variablen verfügbar. Die DataTable wird nach einem String-Feld sortiert.Primefaces Zusammenfassung Zeile in mehreren Zeilen
Irgendwie wird die DataTable mit dem summaryRow in jeder Zeile und nicht in der letzten Zeile angezeigt.
Ich habe gesucht, aber habe nichts gefunden.
Ich benutze Primefaces 5.3 mit JSF 2.2.
Die Tabelle: (https://drive.google.com/file/d/0Bw9aJmydXWmvdU8yTUkyYnp0Ums/view)
Der XHTML:
<p:dataTable
id="rgmStoricoContrattiSogettoCapogruppoDataTable"
value="#{storicoSoggettoProdottoBean.sogegettoProdottoList}"
var="soggetto"
rendered="#{storicoSoggettoProdottoBean.isNdgMemberOfGroup()}"
styleClass="common_datagrid"
emptyMessage="Nessun valore presente"
sortBy="#{soggetto.denominazione}" >
<p:column headerText="Soggetto">
<p:commandLink
value="#{soggetto.denominazione} #{soggetto.ndg} - #{soggetto.ndgCapogruppo}"
actionListener="#{storicoSoggettoProdottoBean.redirectSoggetoProdotto(request.contextPath, soggetto)}"
immediate="true"
process="@this"
style="font-size: 11px !important;" />
</p:column>
<p:column headerText="Rating And./Cerved" width="67" style="text-align: center">
<h:outputText value="#{soggetto.rating}/#{soggetto.ratingCerved}" />
</p:column>
<p:column headerText="Perfez. storico" width="60" style="text-align: right">
<h:outputText value="#{soggetto.perfezionato}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Accord." width="60" style="text-align: right">
<h:outputText value="#{soggetto.accordato}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Utilizz." width="60" style="text-align: right">
<h:outputText value="#{soggetto.utilizzato}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Sconfino" width="60" style="text-align: right">
<h:outputText value="#{soggetto.sconfino}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="In proposta" width="60" style="text-align: right">
<h:outputText value="#{soggetto.inProposta}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Garanzie bancarie" width="60" style="text-align: right">
<h:outputText value="#{soggetto.garanzieBancarie}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Rischio indiretto vs gruppo" width="87" style="text-align: center;">
<h:outputText rendered="#{soggetto.rischioIndirettoVsGruppo == true}" value="SÍ" style="color: green; font-weight: bold;" />
</p:column>
<p:column headerText="Rischio indiretto vs terzi" width="60" style="text-align: right">
<h:outputText value="#{soggetto.rischioIndirettoVsTerzi}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column headerText="Rischio pond." width="60" style="text-align: right">
<h:outputText value="#{soggetto.rischioPonderato}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column width="25">
<p:commandButton
action="#{storicoSoggettoProdottoBean.redirectToStoricoPlafond(request.contextPath, soggetto)}"
immediate="true"
process="@this"
icon="fa fa-file-text-o"
styleClass="imageButton"
style="height: 12px;" />
</p:column>
<p:summaryRow>
<p:column styleClass="totaleRowColor" style="text-align: right;">
<h:outputText value="Totale:" style="font-weight: bold; text-transform: uppercase;" />
</p:column>
<p:column styleClass="totaleRowColor" width="67" />
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.perfezionatoSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.accordatoSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.utilizzatoSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.sconfinoSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.inPropostaSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.garanzieBancarieSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" width="87" />
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.rischioIndirettoVsTerziSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" style="text-align: right;" width="60">
<h:outputText value="#{storicoSoggettoProdottoBean.rischioPonderatoSoggettoSum}">
<f:convertNumber type="currency" currencySymbol="€"/>
</h:outputText>
</p:column>
<p:column styleClass="totaleRowColor" width="25" />
</p:summaryRow>
Hallo! Danke für deine Antwort. In der Tat habe ich das Problem gefunden. Ich dachte mir, dass ich die SummaryRow-Komponente von Primefaces verwenden könnte, um eine "Total" -Linie zu setzen, aber die Zusammenfassungszeile funktioniert anders. Die Zusammenfassungszeile fügt jedes Mal, wenn sich der Wert ändert, eine neue Zeile ein. –
Ich würde vorschlagen, dass Sie in Zukunft eine Antwort für andere Benutzer geben :) – chaeschuechli
Hallo Paulo, wie hast du das Problem behoben. Ich habe das gleiche Problem. Können Sie ein Codebeispiel freigeben? –