]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 24 Aug 2016 08:52:00 +0000 (10:52 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 19 Apr 2017 23:45:36 +0000 (01:45 +0200)
- got rid of redundant hasFoos() as #{ no someController.allFoos().isEmpty()} works fine
- renamed controller method allMobileProvider() -> allMobileProviders()

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestBean.java
src/java/org/mxchange/addressbook/beans/mobileprovider/AddressbookMobileProviderWebRequestController.java
web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl [new file with mode: 0644]
web/WEB-INF/templates/generic/mobile_selection_box.tpl

index d81b5a1ecdf63705c5172e5c4edcf497f564b392..44de627810f11e25c8b35acf4c8b598b8ace7609 100644 (file)
@@ -189,7 +189,7 @@ public class AddressbookAdminMobileProviderWebRequestBean extends BaseAddressboo
                boolean isFound = false;
 
                // Get list of all providers
-               List<MobileProvider> providers = this.mobileController.allMobileProvider();
+               List<MobileProvider> providers = this.mobileController.allMobileProviders();
 
                // Get iterator from it
                Iterator<MobileProvider> iterator = providers.iterator();
index 2d3f7d231ef1587ac960958733075acd6ae81ee6..0d214d79f3e9b3c77dd13554a517f65ffef14558 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.addressbook.beans.mobileprovider;
 
 import java.text.MessageFormat;
-import java.util.Collections;
 import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
@@ -95,13 +94,9 @@ public class AddressbookMobileProviderWebRequestBean extends BaseAddressbookCont
        }
 
        @Override
-       public List<MobileProvider> allMobileProvider () {
-               return Collections.unmodifiableList(this.mobileProviders);
-       }
-
-       @Override
-       public boolean hasMobileProvider () {
-               return (!this.mobileProviders.isEmpty());
+       @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+       public List<MobileProvider> allMobileProviders () {
+               return this.mobileProviders;
        }
 
        /**
index edf1854cdb2591c9760fa0edcc14b68828a431fc..8fef39db7cca1a19b5981ecfa64663d5c6d4af31 100644 (file)
@@ -33,14 +33,7 @@ public interface AddressbookMobileProviderWebRequestController extends Serializa
         * <p>
         * @return A list of all mobile providers
         */
-       List<MobileProvider> allMobileProvider ();
-
-       /**
-        * Checks whether mobile providers are registered
-        * <p>
-        * @return Whether mobile providers are registered
-        */
-       boolean hasMobileProvider ();
+       List<MobileProvider> allMobileProviders ();
 
        /**
         * Observes events being fired after the administrator has added a new
diff --git a/web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl b/web/WEB-INF/templates/admin/mobile/admin_form_mobile_data.tpl
new file mode 100644 (file)
index 0000000..742cc4a
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:f="http://java.sun.com/jsf/core"
+       xmlns:h="http://java.sun.com/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:outputText styleClass="errors" value="#{msg.ERROR_BEAN_HELPER_MOBILE_NUMBER_NOT_SET}" rendered="#{empty beanHelper.mobileNumber}" />
+
+       <div class="para">
+               <fieldset class="fieldset" id="mobile_data">
+                       <legend title="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_MOBILE_NUMBER_DATA_LEGEND}" />
+                       </legend>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="mobileNumberId" value="#{msg.ADMIN_SHOW_PHONE_ID}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:outputText id="mobileNumberId" value="#{beanHelper.mobileNumber.phoneId}" />
+                               </div>
+
+                               <div class="clear"></div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="mobileProvider" value="#{msg.ADMIN_EDIT_MOBILE_PROVIDER}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:selectOneMenu styleClass="select" id="mobileProvider" value="#{adminPhoneController.mobileProvider}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_PROVIDER_REQUIRED}">
+                                               <f:converter converterId="MobileProviderConverter" />
+                                               <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
+                                       </h:selectOneMenu>
+                               </div>
+
+                               <div class="clear"></div>
+
+                               <div class="error_container">
+                                       <h:message for="mobileProvider" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                               </div>
+                       </div>
+
+                       <div class="table_row">
+                               <div class="table_left_medium">
+                                       <h:outputLabel for="mobileNumber" value="#{msg.ADMIN_EDIT_MOBILE_NUMBER}" />
+                               </div>
+
+                               <div class="table_right_medium">
+                                       <h:inputText styleClass="input" id="mobileNumber" size="10" maxlength="20" value="#{adminPhoneController.phoneNumber}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_NUMBER_REQUIRED}">
+                                               <f:validator for="mobileNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+
+                               <div class="clear"></div>
+
+                               <div class="error_container">
+                                       <h:message for="mobileNumber" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                               </div>
+                       </div>
+               </fieldset>
+       </div>
+</ui:composition>
index fd7e654ad4e44cfcf4cb9d7025dc93a152a314e2..65aef5bba92c79531225d50dbe8c3eff7082b7bf 100644 (file)
@@ -9,7 +9,7 @@
                <h:selectOneMenu styleClass="select" id="cellphoneCarrier" value="#{targetController.cellphoneCarrier}">
                        <f:converter converterId="MobileProviderConverter" />
                        <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                       <f:selectItems value="#{mobileProviderController.allMobileProvider()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
+                       <f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
                </h:selectOneMenu>
 
                <h:inputText styleClass="input" id="cellphoneNumber" size="10" maxlength="20" value="#{targetController.cellphoneNumber}">