]> git.mxchange.org Git - jjobs-war.git/commitdiff
Fixed country controller:
authorRoland Häder <roland@mxchange.org>
Wed, 11 May 2016 14:07:42 +0000 (16:07 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 11 May 2016 19:22:55 +0000 (21:22 +0200)
- renamed controller name to not have confusion to
- moved hasCountries/allCountries to session-scoped bean to have full caching

Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java
web/admin/country/admin_country_list.xhtml

index d52d26850cdb201405e0d9bf920d5c63df56a20f..51c68b099ef64af0edb3690351e9d8a8c4007ef5 100644 (file)
@@ -99,6 +99,11 @@ public class JobsCountryWebApplicationBean implements JobsCountryWebApplicationC
                return Collections.unmodifiableList(this.countryList);
        }
 
+       @Override
+       public boolean hasCountries () {
+               return (!this.countryList.isEmpty());
+       }
+
        /**
         * Post-initialization of this class
         */
index 226fcc4584f6bcf3ba2c4b3f2163e42e38ac9811..1f6613214ce8e784183be08c34f28f4d3cb375b0 100644 (file)
@@ -35,6 +35,13 @@ public interface JobsCountryWebApplicationController extends Serializable {
         */
        List<Country> allCountries ();
 
+       /**
+        * Checks whether countries has been registered
+        * <p>
+        * @return Whether countries has been registered
+        */
+       boolean hasCountries ();
+
        /**
         * Observing method when the event is fired that an administrator added a
         * new country
index 63cda07cfbbb75022dff30ccba641a3dc61f14f5..2d1722402f5227fee2059c4b9e0d4aaa1827d471 100644 (file)
@@ -16,7 +16,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <h:dataTable id="table_list_countries" var="country" value="#{adminCountryController.allCountries()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}" rendered="#{adminCountryController.hasCountries()}">
+                       <h:dataTable id="table_list_countries" var="country" value="#{countryController.allCountries()}" styleClass="table_medium" headerClass="table_header_column" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_COUNTRIES}" rendered="#{countryController.hasCountries()}">
                                <h:column>
                                        <f:facet name="header">#{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_ID}</f:facet>