I do not work on filters in Primefaces

0

I have the following xhtml file of Primefaces and the filter is not working in the Order field.

What can it be?

<h:form id="form1">
             <p:growl id="growl" showDetail="true" />
            <p:panel id="cabecera">
               
                   <h:outputText value="Normales : #{tblMaestro.tbl.con_prioridad_normal} - " style="font-size: 12px;font-style: oblique" />
                   <h:outputText value="Prioritarios : #{tblMaestro.tbl.con_prioridad_prioritario}" style="font-size: 12px;font-style: oblique" /> 
                  
                   
                   
                   
                   
                   <br></br> <br></br>
                  <h:outputText value="Ingresar la ubicación : " />
                   <p:selectOneMenu id="Ubicacion" value="#{tblMaestro.vusuario}" style="width:125px">
                    <f:selectItem itemLabel="Todos" itemValue="sa" />
                    <f:selectItem itemLabel="Hogar" itemValue="directorLogisHogar" />
                    <f:selectItem itemLabel="Moda infantil" itemValue="DirectorLogisModaInf" />
                    <f:selectItem itemLabel="Bebes" itemValue="SuperBodBebe" />
                    <f:selectItem itemLabel="Hobbies" itemValue="SuperBodHobbies" />
                    <f:selectItem itemLabel="Todos LV" itemValue="DirectorLogisticoLV" />
                </p:selectOneMenu>
                  <p:spacer width="30" height="10" />
                 <p:commandButton  value="Filtrar"  update="tablero,cabecera"  action="#{tblMaestro.SetFilter()}"
                                   style="background:beige;"
                                   styleClass="colorButton"/>
                
            </p:panel>
             
             
             
             
             
             
             <p:dataTable id="tablero" var="dat" widgetVar="datTable" value="#{tblMaestro.pageData}" filteredValue="#{tblMaestro.filterData}" 
                          paginator="true" rows="20"
                          paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15,20,50,100"
                          >
                
                 <p:column sortBy="#{dat.prioridad}"  headerText="Prioridad" style="width: 80px;font-size: 14px;#{dat.alarmaPrioridad?'background: yellow;':''}" styleClass="#{dat.alarmaPrioridad?'green;':''}">                    
                     <h:outputText value="#{dat.prioridad}"  />
                </p:column>
                
                 <p:column sortBy="#{dat.fecha}" headerText="Fecha" style="width: 120px;font-size: 14px;text-align: center">
                      <h:outputText value="#{dat.fecha}" />
                </p:column>
                
                   <p:column sortBy="#{dat.descripcionUltimoEstado}" headerText="Último Estado" style="width: 80px;font-size: 14px"  >
                       <h:outputText value="#{dat.descripcionUltimoEstado}"  />
                </p:column>
                
                   <p:column sortBy="#{dat.fechaUltimoEstado}" headerText="Fecha último estado" style="width: 80px;font-size: 14px"  >
                       <h:outputText value="#{dat.fechaUltimoEstado}"  />
                </p:column>
                 
                

                <p:column sortBy="#{dat.categoria}" headerText="Categoria" style="width: 80px;font-size: 14px;text-align: center;">
                    <h:outputText value="#{dat.categoria}" />
                </p:column>

                <p:column sortBy="#{dat.cliente}" headerText="Cliente" style="width: 120px;font-size: 14px;text-align: center;">
                    <h:outputText value="#{dat.cliente}" />
                </p:column>

                  <p:column sortBy="#{dat.pedido}" headerText="Pedido" filterBy="#{dat.pedido}" filterMatchMode="contains"  style="width: 60px;font-size: 14px;text-align: center;">                      
                      <p:commandButton value="#{dat.pedido}" action="#{tblMaestro.OpenDetail(dat.pedido)}" update="form1:tblDetalle" onclick="PF('dlgDetail').show();"/>
                </p:column>

                  <p:column sortBy="#{dat.numero_oc}" headerText="Orden de Compra" style="width: 70px;font-size: 14px;text-align: right;">
                      <h:outputText value="#{dat.numero_oc}" style="text-align: right;"/>
                </p:column>
                
                           
                <p:column sortBy="#{dat.fechaVence}" headerText="Fecha vencimiento"  style="width: 120px;font-size: 14px;text-align: center;background: #{dat.alarmaVence}">                                      
                     <h:outputText value="#{dat.fechaVence}" />            
                </p:column>


                 <p:column sortBy="#{dat.unidades}" headerText="Unidades" style="width: 35px;font-size: 14px;text-align: center;">
                     <h:outputText value="#{dat.unidades}" />
                </p:column>

                 <p:column sortBy="#{dat.vendedor}" headerText="Vendedor" style="width: 120px;font-size: 14px;text-align: center;">
                     <h:outputText value="#{dat.vendedor}" />
                </p:column>
                 
            </p:dataTable>
       
             
             
             
             <p:dialog id="detalle" widgetVar="dlgDetail" modal="true"  height="500" width="800" position="top top">
                 
                 <p:dataTable id="tblDetalle" var="det" widgetVar="detTable" value="#{tblMaestro.detailData}">
                 <f:facet name="header">
                        <h:outputText id="txtPedido" value="Pedido : #{tblMaestro.numPedido}"/>
                </f:facet>
                     
                     <p:column headerText="Estado" style="width: 35px;font-size: 14px;text-align: center;">
                         <h:outputText value="#{det.estado}" />
                       </p:column>

                     <p:column headerText="Fecha inicial" style="width: 35px;font-size: 14px;text-align: center;">
                         <h:outputText value="#{det.fechaInicial}" />
                    </p:column>

                     
                     <p:column  headerText="Hora inicial" style="width: 35px;font-size: 14px;text-align: center;">
                         <h:outputText value="#{det.horaInicial}" />
                    </p:column>

                 
                      <p:column  headerText="Usuario" style="width: 35px;font-size: 14px;text-align: center;">
                          <h:outputText value="#{det.usuario}" />
                    </p:column>    
                 </p:dataTable>           
             </p:dialog>
           
             
             
             
                   <br></br>
        Código colores
        <table border="1" style="width:25%">
                    <tr>
                       <th style="width:10px">Color</th>
                      <th style="width:10px">Tiempo Días</th>                       
                    </tr>
                    <tr>
                      <td style="background-color: lightgreen"></td>
                      <td style="width:10px">mayor a 8</td>                       
                    </tr>
                    <tr>
                      <td style="background-color: yellow"></td>
                      <td style="width:10px">Entre 8 y 3</td>                       
                    </tr>
                     <tr>
                      <td style="background-color: orange"></td>
                      <td style="width:10px">Entre 4 y 3</td>                       
                    </tr>
                    <tr>
                      <td style="background-color: lightcoral"></td>
                      <td style="width:10px">Entre 2 y 0</td>                       
                    </tr>
                 
                  </table> 
        
        
             
             
             
             
             <p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()"  />
             <p:dialog  widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
                <p:graphicImage name="/images/loading.gif" />
                <p align="left"> Haciendo la consulta a la base de datos</p>
                 Por favor espere...
            </p:dialog>
             
             
    </h:form>
    
asked by Santiago Matiz 13.03.2018 в 18:10
source

1 answer

0

I already solved it, I publish the answer for people who have the same problem.

The problem is that the information objects of the dataTable were declared as Vector type, when changing them to the List type it started to work

private  Vector<Registro> PageData; // master 
private  Vector<Registro> filterData; // Filtro
private  Vector<com.stilo.detalle.Registro> DetailData; // vector del detalle 

Changed by:

private  List<Registro> PageData; // master 
private  List<Registro> filterData; // Filtro
private  Vector<com.stilo.detalle.Registro> DetailData; // vector del detalle 
    
answered by 13.03.2018 в 23:25