empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1375456 - in /empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main: java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java webapp/pages/employeeListPage.xhtml
Date Tue, 21 Aug 2012 09:53:47 GMT
Author: doebele
Date: Tue Aug 21 09:53:46 2012
New Revision: 1375456

URL: http://svn.apache.org/viewvc?rev=1375456&view=rev
Log:
EMPIREDB-160
jsf-example reset filter

Modified:
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java
    empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java?rev=1375456&r1=1375455&r2=1375456&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/java/org/apache/empire/jsf2/websample/web/objects/EmployeeSearchFilter.java
Tue Aug 21 09:53:46 2012
@@ -20,6 +20,10 @@ package org.apache.empire.jsf2.websample
 
 import java.io.Serializable;
 
+import javax.faces.context.FacesContext;
+
+import org.apache.empire.jsf2.app.FacesUtils;
+
 public class EmployeeSearchFilter implements Serializable
 {
     private static final long serialVersionUID = 1L;
@@ -42,6 +46,12 @@ public class EmployeeSearchFilter implem
         lastName = "";
         departmentId = "";
         gender = "";
+
+        /**
+         * Make sure submitted values are discarded.
+         * Works only, if the "immediate" attribute on the h:commandLink tag is set to true

+         */
+        FacesUtils.setClearSubmittedValues(FacesContext.getCurrentInstance(), true);
     }
 
     public String getEmployeeId()

Modified: empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml?rev=1375456&r1=1375455&r2=1375456&view=diff
==============================================================================
--- empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
(original)
+++ empire-db/trunk/empire-db-examples/empire-db-example-jsf2/src/main/webapp/pages/employeeListPage.xhtml
Tue Aug 21 09:53:46 2012
@@ -46,7 +46,7 @@
 					<e:control column="#{db.EMPLOYEES.GENDER}" value="#{page.searchFilter.gender}" />
 				</sample:formPanelRow>
 				<sample:formButtonRow>
-					<h:commandLink action="#{page.doResetSearch}" value="#{msg.employeeList_resetSearch}"
/>
+					<h:commandLink action="#{page.doResetSearch}" value="#{msg.employeeList_resetSearch}"
immediate="true" />
 					<h:commandLink action="#{page.doSearch}" value="#{msg.employeeList_search}" />
 				</sample:formButtonRow>
 			</sample:formPanel>



Mime
View raw message