]> git.mxchange.org Git - jfinancials-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 26 Aug 2017 22:56:30 +0000 (00:56 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 26 Aug 2017 22:56:30 +0000 (00:56 +0200)
- converted template to custom JSF tag widgets:outputAdminContactDataFormFields
  and replaced all occurrences, 2 optional parameter "formMode" (ex. "mode" and
  "allowEmptyRequiredData" are accepted

Signed-off-by: Roland Häder <roland@mxchange.org>
web/WEB-INF/resources/tags/admin/contact/admin_form_contact_data.tpl [new file with mode: 0644]
web/WEB-INF/resources/tags/table_rows/user_personal_title_table_row.tpl
web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl [deleted file]
web/WEB-INF/templates/admin/user/admin_form_user_personal_data.tpl
web/WEB-INF/widgets.jsf.taglib.xml
web/admin/contact/admin_contact_edit.xhtml
web/admin/contact/admin_contact_list.xhtml

diff --git a/web/WEB-INF/resources/tags/admin/contact/admin_form_contact_data.tpl b/web/WEB-INF/resources/tags/admin/contact/admin_form_contact_data.tpl
new file mode 100644 (file)
index 0000000..964049c
--- /dev/null
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+       xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+       <h:panelGroup styleClass="para" layout="block">
+               <fieldset class="fieldset" id="personal_data">
+                       <legend title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}">
+                               <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}" />
+                       </legend>
+
+                       <widgets:outputPersonalTitleTableRow targetController="#{adminContactController}" allowEmptyRequiredData="#{allowEmptyRequiredData}" />
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="firstName" value="#{msg.ADMIN_PERSONAL_DATA_FIRST_NAME}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="firstName" size="10" maxlength="255" value="#{adminContactController.firstName}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="firstName" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="title" value="#{msg.ADMIN_PERSONAL_DATA_TITLE}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="title" size="5" maxlength="255" value="#{adminContactController.academicTitle}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="title" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="familyName" value="#{msg.ADMIN_PERSONAL_DATA_FAMILY_NAME}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="familyName" size="10" maxlength="255" value="#{adminContactController.familyName}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="familyName" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="street" value="#{msg.ADMIN_PERSONAL_DATA_STREET}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="street" size="20" maxlength="255" value="#{adminContactController.street}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="street" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="houseNumber" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="houseNumber" size="3" maxlength="5" value="#{adminContactController.houseNumber}" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}">
+                                               <f:validateLongRange for="houseNumber" minimum="1" maximum="500" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="houseNumber" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="houseNumberExtension" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER_EXTENSION}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="houseNumberExtension" size="2" maxlength="2" value="#{adminContactController.houseNumberExtension}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="houseNumberExtension" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="zipCode" value="#{msg.ADMIN_PERSONAL_DATA_ZIP_CODE}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="zipCode" size="5" maxlength="6" value="#{adminContactController.zipCode}" validatorMessage="#{msg.ENTERED_ZIP_CODE_INVALID}">
+                                               <f:validateLongRange for="zipCode" minimum="1" maximum="99999" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="zipCode" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="city" value="#{msg.ADMIN_PERSONAL_DATA_CITY}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="city" size="10" maxlength="255" value="#{adminContactController.city}" />
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="city" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="country" value="#{msg.ADMIN_PERSONAL_DATA_COUNTRY_CODE}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:selectOneMenu styleClass="select" id="country" value="#{adminContactController.contactCountry}">
+                                               <f:converter converterId="CountryConverter" />
+                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryCode} (#{msg[country.countryI18nKey]})" />
+                                       </h:selectOneMenu>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="country" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="landLineCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:selectOneMenu styleClass="select divider-right" id="landLineCountryCode" value="#{adminContactController.landLineCountry}">
+                                               <f:converter converterId="CountryConverter" />
+                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText styleClass="input divider-right" id="landLineAreaCode" size="5" maxlength="10" value="#{adminContactController.landLineAreaCode}">
+                                               <f:validator for="landLineAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText styleClass="input" id="landLineNumber" size="10" maxlength="20" value="#{adminContactController.landLineNumber}">
+                                               <f:validator for="landLineNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="faxCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:selectOneMenu styleClass="select divider-right" id="faxCountryCode" value="#{adminContactController.faxCountry}">
+                                               <f:converter converterId="CountryConverter" />
+                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
+                                       </h:selectOneMenu>
+
+                                       <h:inputText styleClass="input divider-right" id="faxAreaCode" size="5" maxlength="10" value="#{adminContactController.faxAreaCode}">
+                                               <f:validator for="faxAreaCode" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+
+                                       <h:inputText styleClass="input" id="faxNumber" size="10" maxlength="20" value="#{adminContactController.faxNumber}">
+                                               <f:validator for="faxNumber" validatorId="PhoneNumberValidator" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <widgets:outputMobileNumberTableRow targetController="#{adminContactController}" labelMessage="#{msg.ADMIN_PERSONAL_DATA_MOBILE_NUMBER}" />
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="emailAddress" value="#{msg.ADMIN_PERSONAL_DATA_EMAIL_ADDRESS}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="emailAddress" size="10" maxlength="255" value="#{adminContactController.emailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+                                               <f:validator validatorId="EmailAddressValidator" />
+                                               <f:attribute name="allowEmptyValue" value="#{allowEmptyRequiredData}" rendered="#{not empty allowEmptyRequiredData}" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="emailAddress" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="contactBirthday" value="#{msg.ADMIN_PERSONAL_DATA_BIRTHDAY}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputText styleClass="input" id="contactBirthday" value="#{adminContactController.birthday}" size="10" converterMessage="#{msg.INVALID_BIRTHDAY}">
+                                               <f:convertDateTime pattern="#{msg.BIRTHDAY_PATTERN}" />
+                                       </h:inputText>
+                               </div>
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="error_container" layout="block">
+                               <h:message for="contactBirthday" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
+                       </h:panelGroup>
+
+                       <h:panelGroup styleClass="table-row" layout="block">
+                               <div class="table-left-medium">
+                                       <h:outputLabel for="contactComment" value="#{msg.ADMIN_PERSONAL_DATA_COMMENT}" />
+                               </div>
+
+                               <div class="table-right-medium">
+                                       <h:inputTextarea id="contactComment" styleClass="input" value="#{adminContactController.comment}" rows="7" cols="25" />
+                               </div>
+                       </h:panelGroup>
+               </fieldset>
+       </h:panelGroup>
+
+       <h:panelGroup styleClass="para notice" layout="block">
+               <ul>
+                       <li>
+                               <h:outputText value="#{msg.ADMIN_CONTACT_DATA_EMAIL_ADDRESS_NOTICE}" />
+                       </li>
+               </ul>
+       </h:panelGroup>
+</ui:composition>
index c28166e726b09ed0eb9c56ee2fcfdeeedd0707f4..ce8b5e88441d650656df3dbc68a80b39419389c3 100644 (file)
@@ -15,7 +15,7 @@
                        </div>
 
                        <div class="table-right-medium">
-                               <h:selectOneMenu styleClass="select" id="userPersonalTitle" value="#{targetController.personalTitle}" required="#{featureController.isFeatureEnabled(targetController.controllerType.concat('_personal_title'))}" requiredMessage="#{msg.FIELD_PERSONAL_TITLE_REQUIRED}">
+                               <h:selectOneMenu styleClass="select" id="userPersonalTitle" value="#{targetController.personalTitle}" required="#{(empty allowEmptyRequiredData or not allowEmptyRequiredData) and featureController.isFeatureEnabled(targetController.controllerType.concat('_personal_title'))}" requiredMessage="#{msg.FIELD_PERSONAL_TITLE_REQUIRED}">
                                        <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
                                        <f:selectItems value="#{genderController.selectableGenders}" var="personalTitle" itemValue="#{personalTitle}" itemLabel="#{msg[personalTitle.messageKey]}" />
                                </h:selectOneMenu>
diff --git a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl
deleted file mode 100644 (file)
index 59ac658..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
-       xmlns="http://www.w3.org/1999/xhtml"
-       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
-       xmlns:f="http://xmlns.jcp.org/jsf/core"
-       xmlns:h="http://xmlns.jcp.org/jsf/html"
-       xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
-       <h:panelGroup styleClass="para" layout="block">
-               <h:outputText value="#{allowEmptyRequiredData}" rendered="#{not empty allowEmptyRequiredData}" />
-               <h:outputText value="allowEmptyRequiredData is empty" rendered="#{empty allowEmptyRequiredData}" />
-
-               <fieldset class="fieldset" id="personal_data">
-                       <legend title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}">
-                               <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}" />
-                       </legend>
-
-                       <widgets:outputPersonalTitleTableRow targetController="#{adminContactController}" allowEmptyRequiredData="#{allowEmptyRequiredData}" />
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="firstName" value="#{msg.ADMIN_PERSONAL_DATA_FIRST_NAME}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="firstName" size="10" maxlength="255" value="#{adminContactController.firstName}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="firstName" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="title" value="#{msg.ADMIN_PERSONAL_DATA_TITLE}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="title" size="5" maxlength="255" value="#{adminContactController.academicTitle}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="title" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="familyName" value="#{msg.ADMIN_PERSONAL_DATA_FAMILY_NAME}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="familyName" size="10" maxlength="255" value="#{adminContactController.familyName}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="familyName" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="street" value="#{msg.ADMIN_PERSONAL_DATA_STREET}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="street" size="20" maxlength="255" value="#{adminContactController.street}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="street" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="houseNumber" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="houseNumber" size="3" maxlength="5" value="#{adminContactController.houseNumber}" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}">
-                                               <f:validateLongRange for="houseNumber" minimum="1" maximum="500" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="houseNumber" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="houseNumberExtension" value="#{msg.ADMIN_PERSONAL_DATA_HOUSE_NUMBER_EXTENSION}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="houseNumberExtension" size="2" maxlength="2" value="#{adminContactController.houseNumberExtension}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="houseNumberExtension" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="zipCode" value="#{msg.ADMIN_PERSONAL_DATA_ZIP_CODE}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="zipCode" size="5" maxlength="6" value="#{adminContactController.zipCode}" validatorMessage="#{msg.ENTERED_ZIP_CODE_INVALID}">
-                                               <f:validateLongRange for="zipCode" minimum="1" maximum="99999" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="zipCode" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="city" value="#{msg.ADMIN_PERSONAL_DATA_CITY}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="city" size="10" maxlength="255" value="#{adminContactController.city}" />
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="city" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="country" value="#{msg.ADMIN_PERSONAL_DATA_COUNTRY_CODE}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:selectOneMenu styleClass="select" id="country" value="#{adminContactController.contactCountry}">
-                                               <f:converter converterId="CountryConverter" />
-                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryCode} (#{msg[country.countryI18nKey]})" />
-                                       </h:selectOneMenu>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="country" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="landLineCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:selectOneMenu styleClass="select divider-right" id="landLineCountryCode" value="#{adminContactController.landLineCountry}">
-                                               <f:converter converterId="CountryConverter" />
-                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
-                                       </h:selectOneMenu>
-
-                                       <h:inputText styleClass="input divider-right" id="landLineAreaCode" size="5" maxlength="10" value="#{adminContactController.landLineAreaCode}">
-                                               <f:validator for="landLineAreaCode" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
-
-                                       <h:inputText styleClass="input" id="landLineNumber" size="10" maxlength="20" value="#{adminContactController.landLineNumber}">
-                                               <f:validator for="landLineNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="faxCountryCode" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:selectOneMenu styleClass="select divider-right" id="faxCountryCode" value="#{adminContactController.faxCountry}">
-                                               <f:converter converterId="CountryConverter" />
-                                               <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
-                                               <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryAbroadDialPrefix}#{country.countryPhoneCode}" />
-                                       </h:selectOneMenu>
-
-                                       <h:inputText styleClass="input divider-right" id="faxAreaCode" size="5" maxlength="10" value="#{adminContactController.faxAreaCode}">
-                                               <f:validator for="faxAreaCode" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
-
-                                       <h:inputText styleClass="input" id="faxNumber" size="10" maxlength="20" value="#{adminContactController.faxNumber}">
-                                               <f:validator for="faxNumber" validatorId="PhoneNumberValidator" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <widgets:outputMobileNumberTableRow targetController="#{adminContactController}" labelMessage="#{msg.ADMIN_PERSONAL_DATA_MOBILE_NUMBER}" />
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="emailAddress" value="#{msg.ADMIN_PERSONAL_DATA_EMAIL_ADDRESS}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="emailAddress" size="10" maxlength="255" value="#{adminContactController.emailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
-                                               <f:validator validatorId="EmailAddressValidator" />
-                                               <f:attribute name="allowEmptyValue" value="#{allowEmptyRequiredData}" rendered="#{not empty allowEmptyRequiredData}" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="emailAddress" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="contactBirthday" value="#{msg.ADMIN_PERSONAL_DATA_BIRTHDAY}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputText styleClass="input" id="contactBirthday" value="#{adminContactController.birthday}" size="10" converterMessage="#{msg.INVALID_BIRTHDAY}">
-                                               <f:convertDateTime pattern="#{msg.BIRTHDAY_PATTERN}" />
-                                       </h:inputText>
-                               </div>
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="error_container" layout="block">
-                               <h:message for="contactBirthday" errorClass="alert-danger" fatalClass="alert-danger" warnClass="alert-warning" />
-                       </h:panelGroup>
-
-                       <h:panelGroup styleClass="table-row" layout="block">
-                               <div class="table-left-medium">
-                                       <h:outputLabel for="contactComment" value="#{msg.ADMIN_PERSONAL_DATA_COMMENT}" />
-                               </div>
-
-                               <div class="table-right-medium">
-                                       <h:inputTextarea id="contactComment" styleClass="input" value="#{adminContactController.comment}" rows="7" cols="25" />
-                               </div>
-                       </h:panelGroup>
-               </fieldset>
-       </h:panelGroup>
-
-       <h:panelGroup styleClass="para notice" layout="block">
-               <ul>
-                       <li>
-                               <h:outputText value="#{msg.ADMIN_CONTACT_DATA_EMAIL_ADDRESS_NOTICE}" />
-                       </li>
-               </ul>
-       </h:panelGroup>
-</ui:composition>
index 9628451e8f1422fc3c7f963e8ff6493ee9e32073..53c67426dd38162c21dd7dbe04868e8d24c2c84f 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
+       xmlns:widgets="http://mxchange.org/jsf/core/widgets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
@@ -13,5 +14,5 @@
                <h:outputText value="#{msg.ADMIN_USER_PERSONAL_DATA_MINIMUM_NOTICE}" />
        </div>
 
-       <ui:include src="/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl" />
+       <widgets:outputAdminContactDataFormFields />
 </ui:composition>
index aa4259be262eea06bcd9127da1ba2b39885dc654..e0d1ac347904f39dc6726dd1d13319e5a4067b3e 100644 (file)
@@ -128,4 +128,21 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
                        <type>org.mxchange.jcoreee.bean.faces.BaseFacesBean</type>
                </attribute>
        </tag>
+       <tag>
+               <tag-name>outputAdminContactDataFormFields</tag-name>
+               <description>This tag renders a fieldset for administrative purposes of contact data.</description>
+               <source>resources/tags/admin/contact/admin_form_contact_data.tpl</source>
+               <attribute>
+                       <name>allowEmptyRequiredData</name>
+                       <description>Whether allow the personal title to be left empty. This might be the case when you create a user and want to select a contact from a selection box. EL code resolving to a boolean may be allowed here.</description>
+                       <required>false</required>
+                       <type>java.lang.Boolean</type>
+               </attribute>
+               <attribute>
+                       <name>formMode</name>
+                       <description>Mode of the form, can be one of "add" or "edit", defaulting to "add".</description>
+                       <required>false</required>
+                       <type>java.lang.String</type>
+               </attribute>
+       </tag>
 </facelet-taglib>
index b1371aff764b76545aca9c684f8c2f32c3205b1a..c762a9ddd53e3ee6443229aef4bcb230a2f4cd8d 100644 (file)
@@ -36,9 +36,7 @@
                                        <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_DATA_MINIMUM_NOTICE}" />
                                </div>
 
-                               <ui:include src="/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl">
-                                       <ui:param name="mode" value="edit" />
-                               </ui:include>
+                               <widgets:outputAdminContactDataFormFields formMode="edit" />
 
                                <div class="table-footer">
                                        <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
index a2b8c2a07237e6470af79790d3849a91e5af3665..0644b20ab613d69172bed77f41bbbf502b753c7e 100644 (file)
@@ -81,9 +81,7 @@
                                        <h:outputText value="#{msg.ADMIN_ADD_CONTACT_MINIMUM_DATA}" />
                                </div>
 
-                               <ui:include src="/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl">
-                                       <ui:param name="allowEmptyRequiredData" value="true" />
-                               </ui:include>
+                               <widgets:outputAdminContactDataFormFields allowEmptyRequiredData="true" />
 
                                <div class="table-footer">
                                        <h:commandButton styleClass="reset divider-right" type="reset" value="#{msg.BUTTON_RESET_FORM}" />