<%@ include file="/includes.jsp" %>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<script type="text/javascript">
function showHospitalList(){
	var isLocalList = document.getElementById('isLocalList');
    if (isLocalList.checked){
        document.getElementById('showHospitalListId').style.display="block";
    }else{
    	document.getElementById('filterHospitalCodeId').value="";
        document.getElementById('showHospitalListId').style.display="none";
    }
}
</script>
<tr>
	<td class="label">List Style</td>
	<td class="input">
		<smvc:select path="formField.fieldType" onchange="update()">
			<smvc:option  value="100">Single Selection</smvc:option >
			<smvc:option  value="101">Mult Selection</smvc:option >
			<smvc:option  value="102">Radio Group</smvc:option >
			<smvc:option  value="103">Checkbox group</smvc:option >
		</smvc:select>
	</td>
</tr>
<tr>
	<td class="label">Alignment</td>
	<td class="input">
		<smvc:select path="formObject.alignment">
			<smvc:option  value="vertical">Vertical</smvc:option >
			<smvc:option  value="horizontal">Horizontal</smvc:option >
		</smvc:select>
	</td>
</tr>
<tr>
	<td class="label">Associated Value List</td>
	<td class="input">
		<smvc:select path="formField.optionsMapDomain" onchange="document.getElementById('optionsMapName').selectedIndex = 0; update()">
			<smvc:option  value=""></smvc:option >
			<smvc:option  value="EMDT">EMDT</smvc:option >
			<smvc:option  value="SYSTEM">SYSTEM</smvc:option >
			<smvc:option  value="DATABASE">DATABASE</smvc:option >
		</smvc:select>
		<smvc:select path="formField.optionsMapName" id="optionsMapName">
			<option value=""></option>
			<c:if test="${formObject.optionsMapDomain ne null}">
				<c:forEach var="namedList" items="${webapp.lists }">
					<%com.ardeo.entities.NamedList namedList=(com.ardeo.entities.NamedList)pageContext.getAttribute("namedList"); %>
					<c:if test="${formObject.optionsMapDomain eq namedList.domain}">
						<smvc:option  value="<%=namedList.getName()%>"><%=namedList.getName()%></smvc:option >
					</c:if>
				</c:forEach>
			</c:if>
		</smvc:select>
	</td>
</tr>
<c:if test="${formObject.inputType eq 5}">
	<tr>
		<td class="label"><b>Show Global List:</b><input type="radio" id="isGlobalList" name="listFilter" onchange="showHospitalList();" <c:if test="${empty formObject.filterHospitalCode}"> checked="checked"</c:if>  /></td> 
		<td class="input"><b>Show Local List:</b><input type="radio" id="isLocalList" name="listFilter" onchange="showHospitalList();" <c:if test="${not empty formObject.filterHospitalCode}">checked="checked"</c:if> />
			<div <c:if test="${empty formObject.filterHospitalCode}"> style="display: none;"</c:if> id="showHospitalListId">
					Choose Hospital :<smvc:select path="formField.filterHospitalCode" id="filterHospitalCodeId">
					<smvc:option  value="" >---select Hospital----</smvc:option >
					<c:forEach var="hospitals" items="${webapp.hospMap}">
						<smvc:option  value="${webapp.hospCodeIdMap[hospitals.key]}" ><c:out value="${hospitals.value}"/></smvc:option >
					</c:forEach>
				</smvc:select>
			</div>
		</td>
	</tr>
</c:if>
<c:if test="${formObjectForm.formField.fieldType eq 101}">
	<tr>
		<td class="label">Height</td>
		<td class="input">
			<smvc:input path="formObject.height" size="3"/>
		</td>
	</tr>
</c:if>