From: Roland Haeder Date: Tue, 11 Apr 2017 10:11:07 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f3301f5cd3c12d1e571d41278ed4f669bb5714ef;p=jjobs-war.git Continued a bit: - added clear() method for clearing bean after form has been processed - added navigation rule --- diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java index 49f509fc..8e63c682 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsAdminCountryWebRequestBean.java @@ -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. diff --git a/web/WEB-INF/faces-config.xml b/web/WEB-INF/faces-config.xml index 8d8ad92a..37737aee 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -256,6 +256,10 @@ admin_delete_country /admin/country/admin_country_delete.xhtml + + admin_list_country + /admin/country/admin_country_list.xhtml + /admin/mobile_provider/admin_mobile_provider_list.xhtml