]> git.mxchange.org Git - pizzaservice-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:46:26 +0000 (01:46 +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/pizzaapplication/beans/mobileprovider/PizzaAdminMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/mobileprovider/PizzaMobileProviderWebRequestController.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 65fbcf3cb456963ce3af4f0ea9a81e68f4473b26..2c6a6a0c3be5447ff273dc43a2b18007391c3382 100644 (file)
@@ -203,7 +203,7 @@ public class PizzaAdminMobileProviderWebRequestBean extends BasePizzaController
                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 a678b272252e7ec896a8242149cebc0dce3bd36f..df08cd823fd9d79ca5f9cf62f1d5ed8b20335542 100644 (file)
@@ -17,7 +17,6 @@
 package org.mxchange.pizzaapplication.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 PizzaMobileProviderWebRequestBean extends BasePizzaController imple
        }
 
        @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 8b4fa3faf8c345d35cc35883bd7fe266c48779e9..d4965e614435314d9cae07efd399b363ce29c44d 100644 (file)
@@ -33,14 +33,7 @@ public interface PizzaMobileProviderWebRequestController extends Serializable {
         * <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}">