[英]Two paginations not working independently in one page - JSF, Primefaces
我有一個網頁,其中有 2 個表格,每個表格中都有分頁。 單擊分頁時會出現問題。 例如,如果我選擇第二個表的第二頁,那么第一個表會自動更改為第二頁。 大家有什么建議嗎? 所以,這是我的代碼:
<div class="col s6">
<div class="row">
<h:form id="dataTable">
<p:dataTable var="pilihCabang" rows="5"
value="#{cabangView.cabangs}"
style="width: 100%; float: left; margin-top: 0px;"
paginator="true" pageLinks="5" rowsPerPageTemplate="5,10,15"
widgetVar="widgetWorkOrder" rowIndexVar="rowIndex"
paginatorPosition="bottom" emptyMessage="No record found"
styleClass="no-dtbl-header" id="pilToko"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<p:columnGroup type="header">
<p:column headerText="Toko" />
</p:columnGroup>
<p:column>
<h:outputText value="#{pilihCabang.nama}" />
<p:commandLink style="float:right">
<p:graphicImage name="delete.png" library="images" width="25px" height="25px"/>
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
</div>
</div>
<div class="col s6">
<div class="row">
<h:form id="dataTabledua">
<p:dataTable var="pilihProduk" rows="5"
value="#{produkView.produks}"
style="width: 100%; float: left; margin-top: 0px;"
paginator="true" pageLinks="5" rowsPerPageTemplate="5,10,15"
widgetVar="widgetWorkOrder" rowIndexVar="rowIndex"
paginatorPosition="bottom" emptyMessage="No record found"
styleClass="no-dtbl-header" id="pilPro"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<p:columnGroup type="header">
<p:column headerText="Produk" />
</p:columnGroup>
<p:column>
<h:outputText value="#{pilihProduk.nama}" />
<p:commandLink style="float:right">
<p:graphicImage name="delete.png" library="images" width="25px" height="25px"/>
</p:commandLink>
</p:column>
</p:dataTable>
</h:form>
</div>
</div>
這是由具有相同 widgetVar 的兩個數據表引起的。 換一個,你會沒事的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.