]> git.mxchange.org Git - jjobs-war.git/commitdiff
Continued a bit:
authorRoland Haeder <roland@mxchange.org>
Tue, 11 Apr 2017 10:11:07 +0000 (12:11 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 11 Apr 2017 10:11:07 +0000 (12:11 +0200)
- added clear() method for clearing bean after form has been processed
- added navigation rule

src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java
web/WEB-INF/faces-config.xml

index 49f509fc4fd31cb46240d0bb72a34e487b86c7f0..8e63c6823677fe7d84ff2a9ed46afe305fdd0f64 100644 (file)
@@ -148,6 +148,9 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsController implement
                // Fire event
                this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry));
 
+               // Clear this bean
+               this.clear();
+
                // Redirect to list
                return "admin_list_country"; //NOI18N
        }
@@ -223,6 +226,20 @@ public class JobsAdminCountryWebRequestBean extends BaseJobsController implement
                return (!this.allCountries().isEmpty());
        }
 
+       /**
+        * Clears this bean's data. This should be called after a form has been
+        * submitted and the processing of the form was successful.
+        */
+       private void clear () {
+               // Clear fields
+               this.setCountryAbroadDialPrefix(null);
+               this.setCountryCode(null);
+               this.setCountryExternalDialPrefix(null);
+               this.setCountryI18nKey(null);
+               this.setCountryIsLocalPrefixRequired(null);
+               this.setCountryPhoneCode(null);
+       }
+
        /**
         * Checks if given country is already added by iterating over the whole list
         * and try to find it.
index 8d8ad92a3ba2f95ac1c8beae1cf4bcf3dd4b6f2a..37737aee949c7e3c81463b039cf7877bc4d8a22f 100644 (file)
                        <from-outcome>admin_delete_country</from-outcome>
                        <to-view-id>/admin/country/admin_country_delete.xhtml</to-view-id>
                </navigation-case>
+               <navigation-case>
+                       <from-outcome>admin_list_country</from-outcome>
+                       <to-view-id>/admin/country/admin_country_list.xhtml</to-view-id>
+               </navigation-case>
        </navigation-rule>
        <navigation-rule>
                <from-view-id>/admin/mobile_provider/admin_mobile_provider_list.xhtml</from-view-id>