} 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);
return isFound;
}
+ @Override
+ public List<Contact> selectableContacts () {
+ return Collections.unmodifiableList(this.selectableContacts);
+ }
+
}
*/
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>
*/
void afterUserUpdatedPersonalData (final UpdatedUserPersonalDataEvent event);
+ /**
+ * Updates list with given user
+ * <p>
+ * @param user User to update
+ */
void updateList (final User user);
/**
<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>