<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ page import='gov.va.med.esr.ui.report.action.ReportConstants' %>

<c:set var="availableText"><bean-el:message key="label.available" /></c:set>
<c:set var="selectedText"><bean-el:message key="label.selected" /></c:set>
<c:set var="ALL"><%=ReportConstants.ALL%></c:set>

<c:set var="selectedEligibilityFactor" value="${reportInfoForm.eligibilityFactors}" />
<esrcore:setLookup var="eligibilityFactorSource" className="gov.va.med.esr.common.model.lookup.ReportEligibilityFactorLU" removeCollection="selectedEligibilityFactor" />
<esrcore:setLookup var="eligibilityFactorTarget" className="gov.va.med.esr.common.model.lookup.ReportEligibilityFactorLU" removeCollection="eligibilityFactorSource" />
<tr>
  <td class="moduleLabel" style="vertical-align: top"><fw:label required="true" property="eligibilityFactors" forId="eligibilityFactorSource" ><bean-el:message key="label.report.eligibilityFactor" />:</fw:label></td>
  <td colspan="2">&nbsp;</td>
</tr>
<tr id="facilityParam<c:out value="${reportFacilityDisplayByVisnVamcFacility}" />">
  <td colspan="3" align="center">
    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="moduleValue"><bean-el:message key="label.available" /></td>
        <td class="moduleValue">&nbsp;</td>
        <td class="moduleValue"><bean-el:message key="label.selected" /></td>
      </tr>
      <tr>
        <td class="moduleLabel">
          <html-el:select title="${availableText}" styleId="eligibilityFactorSource" styleClass="moduleEdit" style="width: 320px" property="dummySelect" multiple="true" size="8">
            <c:if test="${reportInfoForm.allEligibilityFactors == false}">
              <html-el:option styleClass="moduleEdit" value="${ALL}">All Factors</html-el:option>
            </c:if>
            <esrcore:options styleClass="moduleEdit" collection="eligibilityFactorSource" property="code" labelProperty="description"/>
          </html-el:select>
        </td>
        <td class="moduleValue">
          <input title="<bean-el:message key="label.addSelections" />" name="button" onclick="addSelectedItems('eligibilityFactorSource','eligibilityFactorTarget')" type="button" value="<bean-el:message key="button.rightArrow" />"><br>
          <input title="<bean-el:message key="label.removeSelections" />" name="button" onclick="addSelectedItems('eligibilityFactorTarget','eligibilityFactorSource')" type="button" value="<bean-el:message key="button.leftArrow" />">
        </td>
        <td class="moduleValue">
          <html-el:select title="${selectedText}" styleId="eligibilityFactorTarget" styleClass="moduleEdit" style="width: 320px" property="eligibilityFactors" multiple="true" size="8">
            <c:if test="${reportInfoForm.allEligibilityFactors == true}">
              <html-el:option styleClass="moduleEdit" value="${ALL}">All Factors</html-el:option>
            </c:if>
            <esrcore:options styleClass="moduleEdit" collection="eligibilityFactorTarget" property="code" labelProperty="description"/>
          </html-el:select>
        </td>
      </tr>
    </table>
  </td>
</tr>
