Well, my problemn is simple.
I have a complex datatable (sorting + filtering + paginator enabled) inside a tabview, everything is fine with the data on the datatable until I try some filtering. Then when I hit a commandLink(it updates my datable) that refreshs the list that is bound with my datable, I get a empty datatable in my view although its not really empty. Here is a screenshot of my table.
Anyone got a solution or knows why this is happing?
Anyway thx and sry for the poor english!
2.2M1 empty datatable
it´s the default one, the startsWith type.
Here some code.
And here is the actionListener Method on a session scoped backing bean.
I also noticed that if I hit the CommandLink and get the empty datable, and if after that I go to the filtering field and do any keyup action the view back to normal.
Here some code.
Code: Select all
<h:form prependId="false" id="infoUsersForm" style="height: 500px;">
<p:dataTable id="infoUsersDataTable" emptyMessage="Nenhum registro encontrado"
previousPageLinkLabel="«" paginatorPosition="bottom" nextPageLinkLabel="»"
paginator="true" rows="15" rowsPerPageTemplate="15, 30,50,100, 200"
paginatorTemplate="{PreviousPageLink}{PageLinks}{NextPageLink}     Linhas:{RowsPerPageDropdown}       Usuários Logados: #{controllerGeral.listaUser.size()}"
value="#{controllerGeral.listaUser}" var="item">
<f:facet name="header">
Informações de Usuários Logados em Toda UEL
</f:facet>
<p:column filterStyle="width: 140px" width="140" sortBy="#{item.name}" filterBy="#{item.name}">
<f:facet name="header">
<h:outputText value="Login do Usuario"/>
</f:facet>
<h:outputText value="#{item.name}"/>
</p:column>
<p:column filterStyle="width: 120px" width="120" sortBy="#{item.mac}" filterBy="#{item.mac}">
<f:facet name="header">
<h:outputText value="Mac do Usuario"/>
</f:facet>
<h:outputText value="#{item.mac}"/>
</p:column>
<p:column filterStyle="width: 90px" width="90" sortBy="#{item.upTime}" filterBy="#{item.upTime}">
<f:facet name="header">
<h:outputText value="Tempo Logado"/>
</f:facet>
<h:outputText value="#{item.upTime}"/>
</p:column>
<p:column filterStyle="width: 10px" width="10" sortBy="#{item.idControladora}" filterBy="#{item.idControladora}">
<f:facet name="header">
<h:outputText value="C"/>
</f:facet>
<h:outputText value="#{item.idControladora}"/>
</p:column>
<p:column filterStyle="width: 100px" width="100" sortBy="#{item.centroUel}" filterBy="#{item.centroUel}">
<f:facet name="header">
<h:outputText value="Centro"/>
</f:facet>
<h:outputText value="#{item.centroUel}"/>
</p:column>
<p:column filterStyle="width: 265px" width="265" sortBy="#{item.localizacaoUel}" filterBy="#{item.localizacaoUel}">
<f:facet name="header">
<h:outputText value="Localizacao"/>
</f:facet>
<h:outputText value="#{item.localizacaoUel}">
<f:converter converterId="StringLimiterConverter" />
<f:attribute name="limit" value="30"/>
</h:outputText>
</p:column>
</p:dataTable>
<p:commandLink update="infoUsersDataTable" actionListener="#{controllerGeral.carregaInfoUsers}" style="position: absolute; top: 10px; left: 945px;" title="Consultar Informações Gerais">
<p:graphicImage style="border: none;" value="./resources/imagens/wireless.png"/>
</p:commandLink>
</h:form>
Code: Select all
public void carregaInfoUsers(ActionEvent event) {
this.listaUser.clear();
this.listaUser = SnmpUtils.getUserInfo(UserInfoTable.mapControladoras.keySet().toArray(new String[0]));
}
I also noticed that if I hit the CommandLink and get the empty datable, and if after that I go to the filtering field and do any keyup action the view back to normal.
PrimeFaces 3.0-SNAPSHOT, Mojarra 2.0.4, Glassfish 3.0.1/GAE
-
- Posts: 5
- Joined: 22 Sep 2010, 21:01
Hi,
I have the same problem.
Originally, datatable has 10 pages. After apply filter(if I stay on 5th page,for example), the datatable have only 4 records and thus1 page, but Paginator has wrong data after update
I have the same problem.
Originally, datatable has 10 pages. After apply filter(if I stay on 5th page,for example), the datatable have only 4 records and thus1 page, but Paginator has wrong data after update
Code: Select all
paginator:new YAHOO.widget.Paginator({rowsPerPage:20,totalRecords:4,initialPage:5,containers:['resultTable_paginator']}),selectionMode:'single',instantSelect:true,onRowSelectUpdate:'display'});
Code: Select all
......
<p:commandButton value="Apply" action="#{archMGMBean.doFilter}" update=":resultTable-form:resultTable-wrapper"/>
</div>
</h:form>
</p:panel>
<h:form id="resultTable-form" prependId="false">
<p:outputPanel id="resultTable-wrapper">
<p:dataTable id="resultTable" dynamic="true"
var="mgm" value="#{archMGMBean.resultList}" paginator="true" rows="20"
selectionMode="single" selection="#{archMGMBean.selectedMGM}"
onRowSelectUpdate="display">
.......
-
- Posts: 1
- Joined: 28 Oct 2010, 14:21
Hi,
I am also experiencing exactly the same problem described by dhaalves above. Has anybody found/implemented a fix for this yet?
I am also experiencing exactly the same problem described by dhaalves above. Has anybody found/implemented a fix for this yet?
JSF 2.0.3, PrimeFaces 2.2M1, Mojarra 2.0.3, Tomcat 6.0.29