Author: ilya_shaikovsky
Date: 2009-07-29 03:12:02 -0400 (Wed, 29 Jul 2009)
New Revision: 15030
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-7618
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2009-07-29
06:04:23 UTC (rev 15029)
+++
branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalsBean.java 2009-07-29
07:12:02 UTC (rev 15030)
@@ -19,6 +19,9 @@
private List<SelectItem> capitalsOptions = new ArrayList<SelectItem>();
private String capital = "";
+ private String currentStateFilterValue;
+ private String currentNameFilterValue;
+
public List<Capital> autocomplete(Object suggest) {
String pref = (String)suggest;
ArrayList<Capital> result = new ArrayList<Capital>();
@@ -55,6 +58,11 @@
}
}
+ public void resetFilter() {
+ setCurrentNameFilterValue("");
+ setCurrentStateFilterValue("");
+ }
+
public String addCapital(Capital capital) {
capitals.add(capital);
return null;
@@ -80,4 +88,20 @@
return capitalsNames;
}
+ public String getCurrentStateFilterValue() {
+ return currentStateFilterValue;
+ }
+
+ public void setCurrentStateFilterValue(String currentStateFilterValue) {
+ this.currentStateFilterValue = currentStateFilterValue;
+ }
+
+ public String getCurrentNameFilterValue() {
+ return currentNameFilterValue;
+ }
+
+ public void setCurrentNameFilterValue(String currentNameFilterValue) {
+ this.currentNameFilterValue = currentNameFilterValue;
+ }
+
}
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml
===================================================================
---
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml 2009-07-29
06:04:23 UTC (rev 15029)
+++
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml 2009-07-29
07:12:02 UTC (rev 15030)
@@ -19,18 +19,16 @@
</rich:column>
</rich:columnGroup>
</f:facet>
- <rich:column filterBy="#{cap.state}" filterEvent="onkeyup">
- <f:facet name="header">
- <h:outputText value=" " title="Hack due to bug. Shuold be remoevd
till release"></h:outputText>
- </f:facet>
+ <rich:column filterBy="#{cap.state}" filterEvent="onkeyup"
filterValue="#{capitalsBean.currentStateFilterValue}">
<h:outputText value="#{cap.state}"/>
</rich:column>
- <rich:column filterBy="#{cap.name}" filterEvent="onkeyup">
+ <rich:column filterBy="#{cap.name}" filterEvent="onkeyup"
filterValue="#{capitalsBean.currentNameFilterValue}">
<h:outputText value="#{cap.name}"/>
</rich:column>
<f:facet name="footer">
<rich:datascroller id="ds"
renderIfSinglePage="false"></rich:datascroller>
</f:facet>
</rich:dataTable>
+ <a4j:commandButton action="#{capitalsBean.resetFilter}" value="Reset
Current Filtering" reRender="simpletable" ajaxSingle="true"
limitToList="true"/>
</h:form>
</ui:composition>
\ No newline at end of file