]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued again with customer:
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 09:17:27 +0000 (11:17 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 20:17:34 +0000 (22:17 +0200)
- added missing method selectableContacts()
- added missing doc-tag
- better show names and id number, not object

src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java
web/admin/customer/admin_customer_list.xhtml

index b0a3a01db41872a11b15549fd241696519358b12..1d910236fce8b71e38bc0917f5bfc6e6babab7c2 100644 (file)
@@ -127,7 +127,7 @@ public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionContr
                } else if (customer.getCustomerContact().getContactId() < 1) {
                        // Not valid
                        throw new IllegalArgumentException(MessageFormat.format("customer.customerContact.contactId={0} is not valid", customer.getCustomerContact().getContactId())); //NOI18N
-       }
+               }
 
                // Add to list
                this.customerList.add(customer);
@@ -242,4 +242,9 @@ public class PizzaCustomerWebSessionBean implements PizzaCustomerWebSessionContr
                return isFound;
        }
 
+       @Override
+       public List<Contact> selectableContacts () {
+               return Collections.unmodifiableList(this.selectableContacts);
+       }
+
 }
index be6035f079dbf5c927b1926e2199b7dca7009e24..1abb8977544db24e41e14e92f7b9c1716be88872 100644 (file)
@@ -45,6 +45,14 @@ public interface PizzaCustomerWebSessionController extends Serializable {
         */
        void afterAdminAddedCustomer (final AdminAddedCustomerEvent event);
 
+       /**
+        * Returns a list of all selectable contacts for user creation. Contacts
+        * from already existing users are excluded in this list.
+        * <p>
+        * @return A list of all selectable contacts
+        */
+       List<Contact> selectableContacts ();
+
        /**
         * Checks whether the given contact is a customer
         * <p>
index aecd5490bd68ab23a3c816558dc449ee6f941d5e..8109b928db08c3f6c239fa2e754802af102f9588 100644 (file)
@@ -69,6 +69,11 @@ public interface PizzaUserWebSessionController extends Serializable {
         */
        void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
 
+       /**
+        * Updates list with given user
+        * <p>
+        * @param user User to update
+        */
        void updateList (final User user);
 
        /**
index 6289a98925549c6de86e99d26bc9ceb57d6f83cc..200b194a58beea63853da8b9a4e0676321d46f79 100644 (file)
@@ -88,7 +88,7 @@
                                                                <div class="table_right_medium">
                                                                        <h:selectOneMenu class="select" id="customerContact" value="#{adminHelper.contact}" converter="ContactConverter">
                                                                                <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
-                                                                               <f:selectItems value="#{customerController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact}" />
+                                                                               <f:selectItems value="#{customerController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactGender.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
                                                                        </h:selectOneMenu>
                                                                </div>