From: Roland Häder Date: Wed, 27 Apr 2016 09:17:27 +0000 (+0200) Subject: Continued again with customer: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=075cd9b9f4f2d3614b1c898d7b911d35403ab95c;hp=a530e1ff81cefb6f55bfaec532528030501632c0;p=pizzaservice-war.git Continued again with customer: - added missing method selectableContacts() - added missing doc-tag - better show names and id number, not object --- diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java index b0a3a01d..1d910236 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionBean.java @@ -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 selectableContacts () { + return Collections.unmodifiableList(this.selectableContacts); + } + } diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java index be6035f0..1abb8977 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaCustomerWebSessionController.java @@ -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. + *

+ * @return A list of all selectable contacts + */ + List selectableContacts (); + /** * Checks whether the given contact is a customer *

diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java index aecd5490..8109b928 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaUserWebSessionController.java @@ -69,6 +69,11 @@ public interface PizzaUserWebSessionController extends Serializable { */ void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event); + /** + * Updates list with given user + *

+ * @param user User to update + */ void updateList (final User user); /** diff --git a/web/admin/customer/admin_customer_list.xhtml b/web/admin/customer/admin_customer_list.xhtml index 6289a989..200b194a 100644 --- a/web/admin/customer/admin_customer_list.xhtml +++ b/web/admin/customer/admin_customer_list.xhtml @@ -88,7 +88,7 @@

- +