facing trouble with rich:dataScroller page attribute
aniketmurtarkar May 10, 2016 8:20 AM
Hello team,
I am using JSF 2.2.8 and Richfaces 4.5.16.Final (earlier I tried 4.5.13.Final).
I am facing issue with <rich:dataScroller> "page" attribute. I want to update data scroller current page from entering value manually into text box. For this purpose I referred showcase code and followed but I am facing issue with "page" attribute. When "page" attribute is not in datascroller tag, navigation works fine. But required functionality of updating current page manually do not work. When I add "page" attribute, datascroller's "next" and "prev" buttons functionally is disturbed. It is not linear. I tried to use object binding with UIDataScroller but it did not worked to resolve the issue with page attribute.
I have seen couple of comments on other forums where they ask to remove "page" attribute, but I did not understand the purpose of doing this.
bellow is the code snippet.
<rich:panel>
<div>
<rich:dataTable value="#{mySearchManagedBean.payments}"
var="myData" id="extdt_paymen" rows="#{myManagedBean.tableRows}"
styleClass="g-data-table dataTableClass"
binding="#{myManagedBean.dataTablePayments}">
<a4j:ajax immediate="true" event="rowclick"
listener="#{myManagedBean.getPaymentDetails}"
render=":accountPanel1,:pmt_acct_list,:panel_paymentDetails">
</a4j:ajax>
<f:attribute name="sessionmyData"
value="#{mySearchManagedBean.payments}"/>
<rich:column headerClass="g-details-header g-align-center g-no-padding">
<f:facet name="header">
<div class="g-width-5per">
<h:outputText value=" "/>
</div>
</f:facet>
<h:selectBooleanCheckbox id="selectValue"
value="#{myData.selectedVal}"
styleClass="g-no-border paymentSelection #{myData.account.contains('nbsp') ? 'g-display-hidden':''}"
disabled="#{ccaUI['status.ofac'] eq myData.state}">
</h:selectBooleanCheckbox>
</rich:column>
...
...
<rich:column headerClass="g-details-header g-align-center g-no-padding" sortBy="#{myData.valueDate}"
sortOrder="#{searchManagedBean.sortingBean.sortPymtValueDate}"
sortType="custom">
<f:facet name="header">
<div class="g-width-20per">
<a4j:commandLink styleClass="g-no-border"
render=":extdt_paymen,:my_valueDate_asc,:my_valueDate_desc,:my_valueDate_unsort"
actionListener="#{searchManagedBean.sortingBean.sort}">
<h:outputText value="Value Date" escape="false"/>
<f:attribute name="selected" value="valueDate"></f:attribute>
<f:attribute name="view" value="payment"></f:attribute>
<f:attribute name="listToBeSort"
value="#{searchManagedBean.payments}"></f:attribute>
</a4j:commandLink>
<ui:include src="/pages/template/common/sortingArrows.xhtml">
<ui:param name="sortOrderParam"
value="#{searchManagedBean.sortingBean.sortPymtValueDate}"/>
<ui:param name="idPrefix" value="my_valueDate"/>
</ui:include>
</div>
</f:facet>
<h:outputText escape="false" value="#{myData.valueDate}">
</h:outputText>
</rich:column>
</rich:dataTable>
<div style="position: absolute !important;bottom: 62px;height: 16px;width: 33.2%;line-height: 16px;">
<h:outputText value="Page " style="float:left;border: none;"/>
<h:inputText id="pym_ds_numpage" value="#{myManagedBean.dsScrollerPage}" style="float:left;border: none;width:20px;"/>
<h:outputText id="pym_ds_totalpage" value="of #{myManagedBean.totalPages}" style="float:left;border: none;"/>
<h:commandButton id="pym_ds-go" value="Go" style="float:left;border: none;"/>
<rich:dataScroller maxPages="3" id="ds" for="extdt_paymen" stepControls="show" fastControls="hide" style="float:right;border: none;"
render=":pageNumberOutPutTextTM :pym_ds_numpage :pym_ds_totalpage" scrollListener="#{myManagedBean.onScroll}"
page="#{myManagedBean.dsScrollerPage}" reRender=":pym_ds_numpage" binding="#{myManagedBean.scroller}" >
<f:facet name="first">
<span class="g-button-style g-small-button"><span class="g-bullet-icon g-arrow-left-end"></span></span>
</f:facet>
...
...
<f:facet name="next_disabled">
<span class="g-button-style g-small-button inactive" ><span class="g-bullet-icon g-arrow-right" ></span></span>
</f:facet>
</rich:dataScroller>
</div>
</div>
</rich:panel>