Problem in updating page wise total in JSF datatable when using RichFaces datascroller -
I'm creating a datatable column in my JSF page which reveals each column footer with a total of values in column page wise . I am using richfaces to datascroller paging. When I click on the next page in Richfaces datascroller I need to update your footer with a total of column values in the page, which is now a problem for me I have been able to prepare the code to calculate paged total by following this discussion When the page with the dataset load, I managed to see the total columns correctly. When I click the dataset on the next page, the same value remains. For example, when the first page column is a total of 5 and the second page is 3. I have been able to show 5 correctly, when I need it on the next page, click to update to 3, but 5 remains unchanged. It appears that when I click on the next button in the datascroller, then only the idle is removed. Is there a way in RichfAS or JSF to update the footer on every click? Or any other option is different from the Richfaces datascroller which solves my problem My JSF code is My Java code is This is the code where I calculate the total per page Please help me solve it Thank you in advance
public HtmlDataTable getSummaryTable () {summaryTable = new HtmlDataTable (); SummaryTable.setRowClasses ("datatablecontent"); SummaryTable.setColumnClasses ("datatablecontent"); SummaryTable.setHeaderClass ("datatableheader"); SummaryTable.setFooterClass ("datatablecontent"); SummaryTable.setVar ("data"); SummaryTable.setRows (5); //summaryTable.setId("summaryTable "); SummaryTable.setValueExpression ("value", createValueExpression ("# {outboundCall.summaryReports}", List.class)); SummaryTable.setRendered (getDataTableRendered ()); HtmlColumn column1 = getColumnDetails ("Dial Date", "# {data.dialledDate}"); HtmlOutputText footerText1 = new HtmlOutputText (); FooterText1.setValue ("Total"); Column1.setFooter (footerText1); . SummaryTable.getChildren () (Adding Column 1); If (getStatus () equalsIgnoreCase ("success") || getStatus () equalsIgnoreCase ("all") ..) {println ("before footer count"); Int subTotalPrice = 0; (Int i = summaryTable.getFirst); I & lt; summaryTable.getFirst () + summaryTable.getRows () & amp; amp; i. & Lt; getSummaryReports () Size (); i ++) { SummaryReportsForOutBoundCalls DataItem = getSummaryReports () Find (i); String DataMapPrice = DataType .getSuccessCount (); Subtly ++ integer Parasent (Data Itampris); DataItem.setTotalCallsTotal (Integer.toString (subTotalPrice)); } SetFooterTotalToDisplay (integer.trusting (subletrippress)); HTML column column 2 = Millwork column description ("success", "# {data. SuccessCount}"); HtmlOutputText footerText2 = new HtmlOutputText (); FooterText2.setValue (subTotalPrice); Column2.setFooter (footerText2); . SummaryTable.getChildren () add (column 2); } Summary summary; }
public list & lt; Summary UpdatesFootballBootsComments & gt; GetSummaryReports () {int total = 0; // getSummaryTable (); (Int i = summaryTable.getFirst (); i & lt; summaryTable.getFirst () + SummaryTable.Getro () and i & lt; synopsis. (); I ++) {summaryReportsWorldAufboundCallsDataAutam = SummaryReports.Gate (I); String DataMapPrice = DataType .getSuccessCount (); Total + = integer Paracet (datatype); DataItem.setTotalCallsTotal (Integer.toString (total)); } Scroller.setOncomplete ("setValue ('" + total + "')"); Scroller.setOnclick ("setValue ('' + total + '')"); SetFooterTotalToDisplay (Integer.toString (total)); FooterText2.setValue (total); Return Summary; }
After a painful search for one week, I found the A4j: jsfunction solves the problem for me, is there any better solution than this? I am eager to know about it.
Comments
Post a Comment