<%@page import="com.ardeo.entities.autoforms.FormField"%>
<%@ include file="/includes.jsp" %>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<tiles:importAttribute /><%--This imports all tiles atributes to page --%>
<%
	FormField field=(FormField)pageContext.getAttribute("field");
%>
<c:set var="referencedFieldName" value="<%= field.getReferencedField()%>"></c:set>
<c:set var="referencedFieldValue" value="${consultationNoteForm.view.note.values[referencedFieldName].value.code}"/>
<c:if test="${empty referencedFieldValue}">
  	<c:set var="referencedFieldValue" value="xxx" />
</c:if>
<c:catch var="isNumber">
   <c:set var="referencedFieldValue" value="${referencedFieldValue * 1}" />
</c:catch>
<input type="hidden" id="<%= field.getReferencedField()%>_BandingField_<%= field.getName()%>" value="<%= field.getName()%>"/>
<smvc:hidden path='value[${field.name}]' id="${field.name}"/>
<span id="bandingFieldDiv<c:out value="${field.name}"/>">
<c:if test="${not empty field.bandingData}">
	<c:if test="${not empty referencedFieldValue and isNumber == null}">
		<c:forEach var="bandingData" items="${field.bandingData}">
			<c:if test="${referencedFieldValue ge bandingData.lowerBand and  referencedFieldValue le bandingData.higherBand}">
				<font color="<c:out value="${bandingData.assignColor}"/>"><c:out value="${bandingData.message}"/></font>
			</c:if>
		</c:forEach>
	</c:if>
</c:if>
</span>