From f3301f5cd3c12d1e571d41278ed4f669bb5714ef Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Tue, 11 Apr 2017 12:11:07 +0200 Subject: [PATCH] Continued a bit: - added clear() method for clearing bean after form has been processed - added navigation rule --- .../country/JobsAdminCountryWebRequestBean.java | 17 +++++++++++++++++ web/WEB-INF/faces-config.xml | 4 ++++ 2 files changed, 21 insertions(+) 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 -- 2.39.5