return "admin_list_country"; //NOI18N
}
- @Override
- public List<Country> allCountries () {
- // Return "cached" version
- return this.countryController.allCountries();
- }
-
@Override
public String getCountryAbroadDialPrefix () {
return this.countryAbroadDialPrefix;
this.countryPhoneCode = countryPhoneCode;
}
- @Override
- public boolean hasCountries () {
- return (!this.allCountries().isEmpty());
- }
-
/**
* Checks if given country is already added by iterating over the whole list
* and try to find it.
package org.mxchange.addressbook.beans.country;
import java.io.Serializable;
-import java.util.List;
-import org.mxchange.jcountry.data.Country;
/**
* An interface for administrative country beans
*/
public interface AddressbookAdminCountryWebRequestController extends Serializable {
- /**
- * A list of all countries
- * <p>
- * @return All countries
- */
- List<Country> allCountries ();
-
/**
* Adds country to all relevant beans and sends it to the EJB. A redirect
* should happen after successfull creation.
*/
String addCountry ();
- /**
- * Checks whether countries has been registered
- * <p>
- * @return Whether countries has been registered
- */
- boolean hasCountries ();
-
/**
* Getter for abroad dial prefix
* <p>
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
-@Named ("country")
+@Named ("countryController")
@ApplicationScoped
public class AddressbookCountryWebApplicationBean implements AddressbookCountryWebApplicationController {
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
</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>