Java 与dataScroller在同一页上使用两个DataTable时出错
我有两个rich:datatables,每个表都有一个rich-data:scrollerJava 与dataScroller在同一页上使用两个DataTable时出错,java,jsf,richfaces,Java,Jsf,Richfaces,我有两个rich:datatables,每个表都有一个rich-data:scroller <rich:dataTable id="mainTable" summary="#{i18n['br.com.petrobras.crud.datatable.summary']}" styleClass="TableGrid" value="#{bean1.objectDataModel}"
<rich:dataTable id="mainTable"
summary="#{i18n['br.com.petrobras.crud.datatable.summary']}"
styleClass="TableGrid"
value="#{bean1.objectDataModel}"
var="historicoItem"
first="#{bean1.jsfPagination.firstItemIndex}"
rows="#{bean1.jsfPagination.pageSize}">
</rich:dataTable>
<rich:dataScroller id="**scrollerHistorico**" styleClass="Pagination"
for="mainTable" maxPages="1" fastControls="hide"
renderIfSinglePage="false"
page="#{bean1.jsfPagination.currentPageForView}">
</rich:dataScroller>
这样做的影响是,在操作(和日志消息)之后,所有数据都丢失了参考ID。我找到了这个问题的答案 只需要创建一个
h:panelGrid
在每个dataTable+dataScroller中
不要问为什么会这样
<rich:dataTable id="anexoGridId"
summary="#{i18n['br.com.petrobras.crud.datatable.summary']}"
styleClass="TableGrid"
value="#{bean2.objectDataModel}"
var="anexoVar"
first="#{bean2.jsfPagination.firstItemIndex}"
rows="#{bean2.jsfPagination.pageSize}">
</rich:dataTable>
<rich:dataScroller id="**scrollerAnexoTratamentoControle**" styleClass="Pagination"
for="anexoGridId" maxPages="1" fastControls="hide"
renderIfSinglePage="false"
page="#{bean2.jsfPagination.currentPageForView}">
</rich:dataScroller>
12/04/2017 18:59:48 org.richfaces.event.DataTablePreRenderListener processActiveDatascroller
GRAVE: Datascroller components attached to component: formPrincipal:scrollerHistorico have different values of 'page' attribute :
[formPrincipal:scrollerAnexoTratamentoControle: #{bean1.jsfPagination.currentPageForView},
formPrincipal:scrollerHistorico: #{tratamentoControleHistoricoBean.jsfPagination.currentPageForView}]
12/04/2017 18:59:48 org.richfaces.event.DataTablePreRenderListener processActiveDatascroller
GRAVE: Datascroller components attached to component: bean2have different values of 'page' attribute :
[formPrincipal:scrollerAnexoTratamentoControle: #{anexoTratamentoControleBean.jsfPagination.currentPageForView},
formPrincipal:scrollerHistorico: #{tratamentoControleHistoricoBean.jsfPagination.currentPageForView}]