Olá pessoal, estou com um problema!!
Criei um dataTable com selection instant row (funcionando), criei filterBy para cada coluna (funciona o filtro tb), criei tb um filtro global e tb funciona. Meu ManagedBean está setado com SessionScoped. Ja troquei para View e aí simplesmente não aparecem os dados.
Quando realizo qualquer filtragem na tabela, aparece a seguinte mensagem no log do glassfish;
WARNING: DataTable listMoradores:j_idt14 has filtering enabled but no filteredValue model reference is defined, for backward compatibility falling back to page viewstate method to keep filteredValue. It is highly suggested to use filtering with a filteredValue model reference as viewstate method is deprecated and will be removed in future.
Criei uma List para resolver o problema e coloquei o filteredValue, porém adivinha: os itens somem todos na primeira filtragem e não voltam mais quando apago o valor no filtro.
Segue o código:
<h:form id="listMoradores" styleClass="jsfcrud_list_form">
<p:dataTable value="#{moradoresController.listaMoradores}"
var="item"
style="border:solid 1px"
emptyMessage="Não existem Moradores Cadastrados"
paginator="true"
selection="#{moradoresController.atual}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rows="20"
rowKey="#{item.id}"
selectionMode="single"
widgetVar="moradores"
>
<f:facet name="header">
<h:outputText value="Busca Morador:" />
<p:inputText id="globalFilter" onkeyup="moradores.filter()" style="width:150px" />
</f:facet>
<p:ajax event="rowSelect" listener="#{moradoresController.onRowSelectMorador}" update=":tels:tel"/>
<p:column headerText="#{bundle.ListMoradoresTitle_id}" sortBy="#{item.id}" filterBy="#{item.id}">
<h:outputText value=""/>
<h:outputText value="#{item.id}"/>
</p:column>
<p:column headerText="#{bundle.ListMoradoresTitle_nome}" sortBy="#{item.nome}" filterBy="#{item.nome}">
<h:outputText value=""/>
<h:outputText value="#{item.nome}"/>
</p:column>
<p:column headerText="#{bundle.ListMoradoresTitle_endereco}" sortBy="#{item.endereco}" filterBy="#{item.endereco}">
<h:outputText value=""/>
<h:outputText value="#{item.endereco}"/>
</p:column>
</p:dataTable>
</h:form>
O meu Bean é enorme, então se alguém puder me ajudar e precisar de algum código de algum método, pode falar!!
Muito grato,