From 458f09d694577bc3053e17ee3e6131e60520c40b 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 --- .../AddressbookAdminCountryWebRequestBean.java | 17 +++++++++++++++++ web/WEB-INF/faces-config.xml | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java index 848def47..35f9e315 100644 --- a/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java @@ -148,6 +148,9 @@ public class AddressbookAdminCountryWebRequestBean extends BaseAddressbookContro // Fire event this.addedCountryEvent.fire(new AdminEventCountryAdded(updatedCountry)); + // Clear this bean + this.clear(); + // Redirect to list return "admin_list_country"; //NOI18N } @@ -212,6 +215,20 @@ public class AddressbookAdminCountryWebRequestBean extends BaseAddressbookContro this.countryPhoneCode = countryPhoneCode; } + /** + * 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 240e29e9..f5aaab2f 100644 --- a/web/WEB-INF/faces-config.xml +++ b/web/WEB-INF/faces-config.xml @@ -245,6 +245,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