]> git.mxchange.org Git - jfinancials-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:52 +0000 (12:11 +0200)
- added clear() method for clearing bean after form has been processed
- added navigation rule

src/java/org/mxchange/addressbook/beans/country/AddressbookAdminCountryWebRequestBean.java
web/WEB-INF/faces-config.xml

index 848def47ef75460987cef5851b4417da5f56e173..35f9e315b3625196d3b53dfdd73976338378e7a1 100644 (file)
@@ -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.
index 240e29e94ecf8395eabab4631a5e946552d8bd76..f5aaab2f8f6f6cca8b753d264aa936e6c4e0c39d 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>