<%@page import="com.ardeo.entities.autoforms.FormField"%>
<%@ include file="/includes.jsp" %>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<tiles:importAttribute />
<%-- Rendering FormField.inputType  8, button field --%>
<%
	FormField field=(FormField)pageContext.getAttribute("field");
%>
<smvc:hidden path='value[${field.name}]' />
<input type="hidden" id="calculationField_<c:out value="${field.name}"/>" value="<c:out value="${field.getPattern()}"/>"/>
<c:choose>
<c:when test="${consultationNoteForm.view.note.locked eq true}">
	<input type="button" disabled="disabled" onclick="javascript:userCmd('<c:out value="${field.name}"/>');" value="<c:out value="${field.label}"/>">
</c:when>
<c:otherwise>
	<c:if test="${field.fieldType eq 104}">
		<%-- evaluate Calculation --%>
		<input type="button" onclick="javascript:userCmd('<c:out value="${field.name}"/>');" value="<c:out value="${field.label}"/>">
	</c:if>
	<c:if test="${field.fieldType eq 105}">
		<%-- Invoke JS function indirectly, see userFunctionLibrary.jsp --%>
		<div id="button_wait_run" style="display: none" class="message">
			<button class="buttonload"  disabled="disabled"> <img src="../images/ajax-loader-bl.gif" alt="Progress"> In progress... </button>
		</div>
		<div id="button_run"><input type="button" onclick="javascript:invokeUserFunction( '<c:out value="${field.getPattern()}"/>' );" value="<c:out value="${field.label}"/>"></div>
		<span id="status_message"></span>
	</c:if>

</c:otherwise>
</c:choose>
