From 606d133096c282c026b605d0422f09dc2e7dc116 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 11 May 2016 16:07:42 +0200 Subject: [PATCH] Fixed country controller: - renamed controller name to not have confusion to - moved hasCountries/allCountries to session-scoped bean to have full caching MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- .../jjobs/beans/country/JobsCountryWebApplicationBean.java | 5 +++++ .../beans/country/JobsCountryWebApplicationController.java | 7 +++++++ web/admin/country/admin_country_list.xhtml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java index d52d2685..51c68b09 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationBean.java @@ -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 */ diff --git a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java index 226fcc45..1f661321 100644 --- a/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java +++ b/src/java/org/mxchange/jjobs/beans/country/JobsCountryWebApplicationController.java @@ -35,6 +35,13 @@ public interface JobsCountryWebApplicationController extends Serializable { */ List allCountries (); + /** + * Checks whether countries has been registered + *

+ * @return Whether countries has been registered + */ + boolean hasCountries (); + /** * Observing method when the event is fired that an administrator added a * new country diff --git a/web/admin/country/admin_country_list.xhtml b/web/admin/country/admin_country_list.xhtml index 63cda07c..2d172240 100644 --- a/web/admin/country/admin_country_list.xhtml +++ b/web/admin/country/admin_country_list.xhtml @@ -16,7 +16,7 @@ - + #{msg.ADMIN_LIST_COUNTRY_DATA_COUNTRY_ID} -- 2.39.5