- 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>
import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
/**
- * Administrative country bean
+ * An administrative country bean
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
return Collections.unmodifiableList(this.countryList);
}
+ @Override
+ public boolean hasCountries () {
+ return (!this.countryList.isEmpty());
+ }
+
/**
* Post-initialization of this class
*/
*/
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
* @param event Event instance
*/
void afterAdminAddedCountry (final AdminAddedCountryEvent event);
+
}
</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>