 <%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>


<%@ taglib uri="/tags/authz" prefix="auth" %>

<c:set var="requiredText"><bean-el:message key="label.required"/></c:set>

<script type="text/javascript">

<!-- If language dropdown selection changes, then blank out the langauge entry date. -->
function languageOnChange(selectedIndex) {
   document.getElementById("languageEntryDate").value = '';
}

</script>

<tr>

    <td class="moduleLabel"><fw:label property="preferredLanguageCode" forId="preferredLanguageCode"><bean-el:message key="label.required.prefix" />&nbsp;
         <bean-el:message key="label.personal.preferredLanguage"/></fw:label>:</td>
    
    <td class="moduleValue">
    <!-- Table containing the list and the buttons -->
        <table width="50%" border="0" cellpadding="0" cellspacing="1">
            <tr>
                  <td class="moduleValue">
                    <c:set var="preferredLanguageText"><bean-el:message key="label.personal.preferredLanguage"/></c:set>
                    <html-el:select styleClass="moduleEdit" title="${requiredText}, ${preferredLanguageText}" 
                        styleId="preferredLanguageCode" property="preferredLanguageCode" onchange="languageOnChange()">                      
                      <esrcore:options collection="gov.va.med.esr.common.model.lookup.Language" property="code" labelProperty="description" name="languageList"/>
                    </html-el:select>
                  </td>                                  
                  <td class="moduleLabel"><fw:label property="languageEntryDate" forId="languageEntryDate"><bean-el:message key="label.required.prefix" />&nbsp;
                     <bean-el:message key="label.personal.preferredLanguageEntryDate"/></fw:label>:
                  </td>

                  <td  class="moduleValue">
                    <c:set var="languageEntryDateText"><bean-el:message key="label.personal.preferredLanguageEntryDate"/>&nbsp;
                    <c:out value="${mmddyyyyText}"/></c:set>
                    <html-el:text title="${requiredText}, ${languageEntryDateText}" styleId="languageEntryDate" styleClass="moduleEdit" property="languageEntryDate" size="20" maxlength="21"/>&nbsp;<bean-el:message key="label.mmddyyyy"/>
                  </td>                  
            </tr>
        </table>    
    </td>
</tr>