]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 1 Sep 2016 15:48:25 +0000 (17:48 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 1 Sep 2016 19:44:21 +0000 (21:44 +0200)
- moved error messages outside table_row container
- added error message for email address in admin contact data form
- replaced FacetException with a nice JSF message

src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl

index d78d7062b0f8e9e495f4c44074e6a1cb4cf3814e..5da800a5b25b72c8bea7379069a1973e5b02fb56 100644 (file)
@@ -279,7 +279,8 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                        throw new FaceletException(new UserNameAlreadyRegisteredException(user));
                } else if ((this.beanHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) {
                        // Email address is already used
-                       throw new FaceletException(new EmailAddressAlreadyRegisteredException(user));
+                       this.showFacesMessage("admin_add_user:emailAddress", "ERROR_EMAIL_ADDRESS_ALREADY_USED"); //NOI18N
+                       return ""; //NOI18N
                } else if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) {
                        // Empty password entered, then generate one
                        password = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
index 8e8f5431f264cee49156026a65f423b28574dd0a..f3b5f3b4d2972d07f2bd6515704b68127b8ddd01 100644 (file)
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="gender" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="gender" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="firstName" value="#{msg.ADMIN_PERSONAL_DATA_FIRST_NAME}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="firstName" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="firstName" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="title" value="#{msg.ADMIN_PERSONAL_DATA_TITLE}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="title" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="title" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="familyName" value="#{msg.ADMIN_PERSONAL_DATA_FAMILY_NAME}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="familyName" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="familyName" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="street" value="#{msg.ADMIN_PERSONAL_DATA_STREET}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="street" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="street" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="houseNumber" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="houseNumber" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="houseNumber" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="houseNumberExtension" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER_EXTENSION}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="houseNumberExtension" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="houseNumberExtension" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="zipCode" value="#{msg.ADMIN_PERSONAL_DATA_ZIP_CODE}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="zipCode" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="zipCode" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="city" value="#{msg.ADMIN_PERSONAL_DATA_CITY}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="city" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="city" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="country" value="#{msg.ADMIN_PERSONAL_DATA_COUNTRY_CODE}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="country" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="country" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
                                                <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>
-
-                                       <h:inputText styleClass="input" id="mobileNumber" size="10" maxlength="20" value="#{adminContactController.mobileNumber}">
-                                               <f:validator for="mobileNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
                                </div>
 
                                <div class="clear"></div>
                        </div>
 
+                       <h:inputText styleClass="input" id="mobileNumber" size="10" maxlength="20" value="#{adminContactController.mobileNumber}">
+                               <f:validator for="mobileNumber" validatorId="PhoneNumberValidator" />
+                       </h:inputText>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="emailAddress" value="#{msg.ADMIN_PERSONAL_DATA_EMAIL_ADDRESS}" />
                                <div class="clear"></div>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="emailAddress" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="contactBirthday" value="#{msg.ADMIN_PERSONAL_DATA_BIRTHDAY}" />
                                </div>
 
                                <div class="clear"></div>
-
-                               <h:panelGroup styleClass="error_container" layout="block">
-                                       <h:message for="contactBirthday" errorClass="errors" fatalClass="errors" warnClass="errors" />
-                               </h:panelGroup>
                        </div>
 
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="contactBirthday" errorClass="errors" fatalClass="errors" warnClass="errors" />
+                       </h:panelGroup>
+
                        <div class="table_row">
                                <div class="table_left_medium">
                                        <h:outputLabel for="contactComment" value="#{msg.ADMIN_PERSONAL_DATA_COMMENT}" />