This content has been marked as final.
Show 3 replies
-
1. Re: search function using filterBy
ilya_shaikovsky Jun 3, 2008 4:21 AM (in response to zed1284)in this demo code - built in filtering used. So there is inplaces in headers generated automatically.
If you need to implement external filtering. (with external filtering field and serch button ) - explore second tab of filtering demo page. -
2. Re: search function using filterBy
zed1284 Jun 4, 2008 5:01 AM (in response to zed1284)Thx! But I still have a problem with external filtering. When I type in the first time, it disappears after 500 ms and then I can type in whatever I want and nothing happens.
This is my View:<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" template="layout/template.xhtml"> <ui:define name="body"> <s:link value="Home" view="/home.xhtml" /> -> <s:link value="Produktgruppenverwaltung" disabled="true" /> <h:messages globalOnly="true" styleClass="message"/> <rich:panel rendered="#{identity.loggedIn}"> <h:form> <rich:spacer height="15" /> <s:button value="Neue Produktgruppe hinzufuegen" view="/produktGruppenAdd.xhtml" /> <rich:dataTable id="prodgruppeID" rows="10" columnClasses="col" value="#{prodgruppeAction.getListe()}" var="prod"> <f:facet name="header"> <rich:columnGroup> <rich:column> <h:outputText styleClass="headerText" value="Bezeichnung" /> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Bearbeiten" /> </rich:column> <rich:column> <h:outputText styleClass="headerText" value="Löschen" /> </rich:column> </rich:columnGroup> </f:facet> <rich:column filterMethod="#{prodgruppeAction.filterPG}"> <f:facet name="header"> <h:inputText value="#{prodgruppeAction.filterValue}" id="input"> <a4j:support event="onkeyup" reRender="prodgruppeID" ignoreDupResponses="true" requestDelay="500" focus="input" /> </h:inputText> </f:facet> <h:outputText value="#{prod.bezeichnung}"/> </rich:column> <rich:column> <f:facet name="header"> <h:outputText title="Hack due to bug">...</h:outputText> </f:facet> <h:commandLink action="#{prodgruppeAction.showDetailsEdit(prod)}" value="Bearbeiten"/> </rich:column> <rich:column> <f:facet name="header"> <h:outputText title="Hack due to bug">...</h:outputText> </f:facet> <h:commandButton value="Löschen" action="#{prodgruppeAction.delete(prod)}"/> </rich:column> </rich:dataTable> <rich:datascroller align="left" for="prodgruppeID" maxPages="20" id="sc2" /> </h:form> </rich:panel> </ui:define> </ui:composition>
And this is my FilterMethod as discribed here http://livedemo.exadel.com/richfaces-demo/richfaces/filteringFeature.jsf;jsessionid=FB3596EDBFA5083818701D1BC1B103B1:public boolean filterPG(Object current) { Produktgruppe currentPG = (Produktgruppe)current; System.out.println(currentPG.getBezeichnung()); if (filterValue.length()==0) { return true; } if (currentPG.getBezeichnung().toLowerCase().startsWith(filterValue.toLowerCase())) { return true; }else { return false; } }
-
3. Re: search function using filterBy
zed1284 Jun 5, 2008 6:26 AM (in response to zed1284)Has nobody any ideas? Does anybody know an example with filtering? This is very important for me!!