2.2M1 empty datatable

UI Components for JSF
Post Reply
dhaalves
Posts: 13
Joined: 27 Apr 2010, 16:54
Location: Brazil

17 Sep 2010, 22:10

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.

Image

Anyone got a solution or knows why this is happing?


Anyway thx and sry for the poor english!
PrimeFaces 3.0-SNAPSHOT, Mojarra 2.0.4, Glassfish 3.0.1/GAE

User avatar
michiel
Posts: 240
Joined: 07 Jun 2010, 09:12
Location: Belgium

20 Sep 2010, 09:48

how is your filtering implemented ?
JSF-2.0, mojarra-2.0.2-FCS and PrimeFaces-2.1 on GlassFish v3.0.1 (build 22)

dhaalves
Posts: 13
Joined: 27 Apr 2010, 16:54
Location: Brazil

20 Sep 2010, 13:44

it´s the default one, the startsWith type.

Here some code.

Code: Select all

 <h:form prependId="false" id="infoUsersForm" style="height: 500px;">
                    <p:dataTable id="infoUsersDataTable" emptyMessage="Nenhum registro encontrado"
                                 previousPageLinkLabel="&laquo;" paginatorPosition="bottom" nextPageLinkLabel="&raquo;"
                                 paginator="true" rows="15" rowsPerPageTemplate="15, 30,50,100, 200"
                                 paginatorTemplate="{PreviousPageLink}{PageLinks}{NextPageLink}&ensp;&ensp;&ensp;&ensp;&ensp;Linhas:{RowsPerPageDropdown} &ensp;&ensp;&ensp;&ensp;&ensp; Usu&aacute;rios Logados:&ensp;#{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>
And here is the actionListener Method on a session scoped backing bean.

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

AndreyVorontsov
Posts: 5
Joined: 22 Sep 2010, 21:01

22 Sep 2010, 22:08

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

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">
.......

louis.jordaan
Posts: 1
Joined: 28 Oct 2010, 14:21

28 Oct 2010, 14:30

Hi,

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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Analytics-24 and 36 guests