У меня есть простой графический интерфейс Primefaces с SummaryRow. Значения этого SummaryRow вычисляются в ManagedBean и доступны в простых переменных BigDecimal. DataTable упорядочивается по строкам.Сводка строк Сводка строк в нескольких строках
Как-то отображается DataTable с summaryRow в каждой строке, а не в последней строке.
Я искал это, но ничего не нашел.
Я использую Primefaces 5.3 с JSF 2.2.
В таблице: (https://drive.google.com/file/d/0Bw9aJmydXWmvdU8yTUkyYnp0Ums/view)
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>
Привет! Спасибо, что ответили. Фактически, я нашел проблему. Я думал, что я могу использовать компонент SummaryRow в Primefaces для размещения строки «Total», но сводная строка работает по-другому. Сводная строка будет вставлять новую строку каждый раз при изменении значения. –
Я предлагаю вам дать ответ другим пользователям в будущем: – chaeschuechli
Привет, Пауло, как вы решили проблему. У меня такая же проблема. Можете ли вы поделиться образцом кода? –