开发者

primefaces datatable filtering

开发者 https://www.devze.com 2023-03-28 13:00 出处:网络
I use the car example from primefaces site, but it works only one time and do not refresh values after onkeyup event. Can somebody help me?:) TOM

I use the car example from primefaces site, but it works only one time and do not refresh values after onkeyup event. Can somebody help me?:) TOM

Code which I use(from tutorial):

<p:dataTable var="car" value="#{tableBean.carsSmall}"  
                         emptyMessage="No cars found with given criteria"
                         widgetVar="carsTable">  

                <f:facet name="header">  
                    <p:outputPanel>  
                        <h:outputText value="Search all fields:" />  
                        <p:inputText id="globalFilter" onkeyup="carsTable.filter()" style="width:150px" />  
                    </p:outputPanel>  
                </f:facet>  

                <p:column filterBy="#{car.model}"   
                          headerText="Model" footerText="contains"  
                          filterMatchMode="contains">  
                    <h:outputText value="#{car.model}" />  
                </p:column>  

                <p:column filterBy="#{car.year}"  
                          headerText="Year" footerText="startsWith">  
                    <h:outputText value="#{car.year}" />  
                </p:column>  

                <p:column filterBy="#{car.manufacturer}"   
                          h开发者_如何学GoeaderText="Manufacturer" footerText="exact"  
                          filterOptions="#{tableBean.manufacturerOptions}"  
                          filterMatchMode="exact">  
                    <h:outputText value="#{car.manufacturer}" />  
                </p:column>  

                <p:column filterBy="#{car.color}"  
                          headerText="Color" footerText="endsWith" filterMatchMode="endsWith">  
                    <h:outputText value="#{car.color}" />  
                </p:column>  
            </p:dataTable>  

        </h:form> 

and TableBean exactly like this in tut

0

精彩评论

暂无评论...
验证码 换一张
取 消