
<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="com.blueland.bpm.engine.config.model.*"%>
<%@ include file="/commons/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/meta.jsp"%>
<base href="<%=basePath%>">
<title>全局变量编辑</title>
<script type="text/javascript">
	$(document).ready(function() {
		/*$("#submitButton").click(function() {
			//用jquery中的ajax方法，向服务器提交请求 
			jQuery.ajax({
				type : "POST",
				url : "${ctx}/dataObjectRelation/update.do",
				data : $('#myform').serialize(),
				success : function(resp) {
					alert(resp);
					art.dialog.opener.location.reload();
				}
			});
		});*/
		var demo=$("#myform").Validform({tiptype:4, datatype:{"objKey": /^\w+$/},callback:function(data){  
			alert("编辑成功");
			art.dialog.opener.location.reload();
		}});
		
		$("#submitButton").click(function(){
			demo.ajaxPost();
			return false;
		});
		
		//$('#objKey').keyup(trimkeyup);
	});
	
</script>
</head>
<body class="white-page">
	<form action="${ctx}/dataObjectRelation/update.do" method="post" id="myform">
		<div class="main-container" id="main-container">
			<div class="panel panel-primary">
				<div class="panel-body">
					<table class='table table-bordered form-table' border="0" cellspacing="0"
						cellpadding="0" id="myTable">
						<!-- 存放隐藏域的区域 -->
						<input type="hidden" name="dorId" id="dorId" value="${dataObjectRelation.dorId}" />
						
						<input type="hidden" name="dataObject.objScope" id="objScope" value="P" />
						<input type="hidden" name="processDefId" id="processDefId" value="${dataObjectRelation.processDefId}" />
						<input type="hidden" name="processDefName" id="processDefName" value="${dataObjectRelation.processDefName }" />
						<input type="hidden" name="activityDefId" id="activityDefId" value="${dataObjectRelation.activityDefId}" />
						<input type="hidden" name="targetActId" id="targetActId" value="${dataObjectRelation.targetActId}" />
						<input type="hidden" name="dorType" id="dorType" value="${dataObjectRelation.dorType}" />
						<input type="hidden" id="objId" name="dataObject.objId" value="${dataObjectRelation.dataObject.objId}" />
						<!-- 存放表单的区域 -->
						
						<tr>
							<th>属性KEY<font color="red">*</font>：
							</th>
							<td><input type="text" name="dataObject.objKey" 
								value="${dataObjectRelation.dataObject.objKey}"  id="objKey"
								datatype="objKey" nullmsg="请输入变量KEY！" errormsg="变量KEY只能输入字母、数字以及下划线！"
								class="input" 
								onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"/>
							</td>
						</tr>
						<tr>
							<th>属性名称<font color="red">*</font>：
							</th>
							<td><input type="text" name="dataObject.objName" 
								value="${dataObjectRelation.dataObject.objName}" id="objName"
								datatype="*1-12" nullmsg="请输入变量名称！" errormsg="变量名称不能超过12个汉字！"
								class="input" /></td>
						</tr>
						<tr>
							<th>属性值<font color="red">*</font>：
							</th>
							<td><input type="text" name="dataObject.objValue" 
								value="${dataObjectRelation.dataObject.objValue}"
								datatype="*1-500" nullmsg="请输入变量值！" errormsg="变量值不能超过500个字符！"
								id="objValue" class="input" /></td>
						</tr>
						<tr>
							<th>属性类型<font color="red">*</font>：
							</th>
							<td>
								<select name="dataObject.objType" id="objType">
									<option value="String" ${dataObjectRelation.dataObject.objType=="String" ? "selected": ""}>字符串</option>
									<option value="Number"  ${dataObjectRelation.dataObject.objType=="Number" ? "selected": ""}>数字</option>
									<option value="Boolean"  ${dataObjectRelation.dataObject.objType=="Boolean" ? "selected": ""}>布尔值</option>
									<option value="Object"  ${dataObjectRelation.dataObject.objType=="Object" ? "selected": ""}>对象</option>
								</select>
							</td>
						</tr>
						<tr>
							<th>备注：</th>
							<td><input type="text" name="dataObject.objRemark" 
								id="objRemark" class="input" 
								value="${dataObjectRelation.dataObject.objRemark}"/></td>
						</tr>
						
					</table>
					<div class="col-md-offset-1 col-md-9" style="text-align: center;">
						<a class="btn btn-sm btn-primary" id="submitButton">保存<i class="ace-icon fa fa-save bigger-110"></i></a>
						<a class="btn btn-sm btn-primary" onclick="art.dialog.close();">关闭<i class="ace-icon fa fa-times bigger-110"></i></a>
					</div>
				</div>

			</div>
		</div>
	</form>

</body>
</html>
