roaddefectform.jsp
来自「Java的框架」· JSP 代码 · 共 492 行 · 第 1/2 页
JSP
492 行
<%@ include file="/common/taglibs.jsp"%>
<mcaps:userPreference key="map" name="map" scope="page"/>
<c:set var="datetimeformat"><fmt:message key="datetime.format"/></c:set>
<c:if test="${param.method == 'add'}">
<c:set var="title"><fmt:message key="addRoadDefect.title"/></c:set>
<c:set var="heading"><fmt:message key="addRoadDefect.heading"/></c:set>
<c:set var="message"><fmt:message key="addRoadDefect.message"/></c:set>
<c:url var="roadWindowUrl" value="/popup/roadsAlphabetSort.action"/>
</c:if>
<c:if test="${param.method == 'edit'}">
<c:set var="title"><fmt:message key="editRoadDefect.title"/></c:set>
<c:set var="heading"><fmt:message key="editRoadDefect.heading"/></c:set>
<c:set var="message"><fmt:message key="editRoadDefect.message"/></c:set>
<c:url var="roadWindowUrl" value="/popup/roadsById.action"/>
</c:if>
<html>
<head>
<title><c:out value="${title}"/></title>
<content tag="heading">
<c:out value="${heading}"/>
</content>
<script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
</head>
<script>
var objChildWindow=0;
var bboxStr = '<c:out value="${roadDefect.road.bbox}"/>';
//Show the road list pop up form
function showList(id) {
var roadId;
if (id) {
roadId = id
}else{
roadId = window.document.forms["roadDefectForm"].elements["road.id"].value;
}
//sList = window.open("<c:out value="${roadWindowUrl}"/>", "list", "width=200,height=800");
if (objChildWindow == 0){
var param = "";
if(roadId) {param = "?roadId=" + roadId;}
objChildWindow = window.open("<c:out value="${roadWindowUrl}"/>"+param, "roadPopUp", "width=420,height=500,toolbar=no,menubar=no");
}else{
objChildWindow.focus();
}
}
//Remove the link to the pop up form
function remLink() {
if (window.objChildWindow && window.objChildWindow.open){
window.objChildWindow.opener = null;
objChildWindow = 0;
}
}
//Perform cleanup during form reload or unload
function doUnload(){
if (window.objChildWindow && window.objChildWindow.open && !window.objChildWindow.closed){
window.objChildWindow.close();
window.objChildWindow.opener = null;
objChildWindow = 0;
}
}
function getBboxStr(){
return bboxStr;
}
<c:choose>
<c:when test="${map == 'mb'}">
//Function called after the mapbuilder scripts have loaded completely
//This function will set a timer with interval of 100ms to fire
//the initMap method so that the map is zoomed to the road
//and the coordinate is set
function onMbDoLoadComplete() {
//bbox format X1,Y1,X2,Y2
var bbox = bboxStr.replace("BOX(","").replace(")","").replace(/(\s)/g, ",");
window.cgiArgs['bbox'] = bbox;
window.cgiArgs['XYCoord'] = '<c:out value="${roadDefect.coordinates}"/>';
window.cgiArgs["defaultAOI"] = bbox;
//config.defaultaoi = getBboxArray(bbox);
}
//Returns the bbox in array format from the string format [BOX(X1 Y1,X2 Y2)]
/*
function getBboxArray(bbox){
var bboxArray = new Array();
bboxArray = bbox.split(",");
var ul = new Array(parseFloat(bboxArray[0]),parseFloat(bboxArray[3]));
var lr = new Array(parseFloat(bboxArray[2]),parseFloat(bboxArray[1]));
return new Array(ul,lr);
}
function setFeatureProperty(roadid, roadname, coord){
window.document.forms["roadDefectForm"].elements["road.id"].value = roadid;
window.document.forms["roadDefectForm"].elements["road.name"].value = roadname;
setCoordinate(coord);
}
//Sets the coordinate of the feature
function setCoordinate(coord){
window.document.forms["roadDefectForm"].elements["coordinates"].value = coord;
}
*/
//Zoom the map to the bbox of the road
function zoomToBox(bbox){
if (config.objects.mainMap != null){
//Set config.defaultaoi to update AOI for ZoomToAOI button
config.defaultaoi = bbox;
config.objects.mainMap.extent.zoomToBox(bbox[0],bbox[1]);
}
}
</c:when>
<c:otherwise>
//Zoom the map to the bbox of the road
function zoomToBox(bbox){
mapframe.zoomToBox(bbox);
}
</c:otherwise>
</c:choose>
</script>
<body onUnload="javascript:doUnload();" >
<span id="message"><c:out value="${message}"/></span>
<div class="separator"></div>
<spring:bind path="roadDefect.*">
<c:if test="${not empty status.errorMessages}">
<div class="error">
<c:forEach var="error" items="${status.errorMessages}">
<img src="<c:url value="/images/iconWarning.gif"/>"
alt="<fmt:message key="icon.warning"/>" class="icon" />
<c:out value="${error}" escapeXml="false"/><br />
</c:forEach>
</div>
</c:if>
</spring:bind>
<c:set var="pageButtons">
<tr>
<td>
</td>
<td class="buttonBar">
<c:if test="${param.method == 'add'}">
<input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.add"/>" />
<input type="submit" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
</c:if>
<c:if test="${param.method == 'edit'}">
<input type="submit" class="button" name="save" onclick="bCancel=false" value="<fmt:message key="button.save"/>" />
<input type="submit" class="button" name="delete" onclick="bCancel=true;return confirmDelete('Road Defect')" value="<fmt:message key="button.delete"/>" />
<input type="submit" class="button" name="cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
</c:if>
</td>
</tr>
</c:set>
<form method="post" action="<c:url value="/roadDefectForm.action"/>" id="roadDefectForm" onsubmit="return onFormSubmit(this)">
<c:if test="${param.method != 'add'}">
<spring:bind path="roadDefect.id">
<p><h3><fmt:message key="roadDefect.fullid"/>: <c:out value="${status.value}"/></h3></p>
<input type="hidden" id="roadDefectId" name="roadDefectId" value="<c:out value="${status.value}"/>">
</spring:bind>
<table>
<tr>
<td><fmt:message key="roadDefect.creationTime"/>:</td>
<td><fmt:formatDate value="${roadDefect.creationTime}" pattern="${datetimeformat}"/></td>
</tr>
<tr>
<td><fmt:message key="roadDefect.lastModifiedTime"/>:</td>
<td><fmt:formatDate value="${roadDefect.lastModifiedTime}" pattern="${datetimeformat}"/></td>
</tr>
</table>
</c:if>
<p><h3><fmt:message key="roadDefect.subtitle.contact"/></h3><p>
<!-- input type="hidden" name="from" value="<c:out value="${param.from}"/>" / -->
<input type="hidden" name="method" value="<c:out value="${param.method}"/>" />
<table class="detail">
<tr>
<th>
<mcaps:label key="roadDefect.contact.firstName"/>
</th>
<td>
<spring:bind path="roadDefect.contact.firstName">
<input type="text" maxlength="20" width="100%" size="20"
id="<c:out value="${status.expression}"/>"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="roadDefect.contact.lastName"/>
</th>
<td>
<spring:bind path="roadDefect.contact.lastName">
<input type="text" maxlength="20" width="100%" size="20"
id="<c:out value="${status.expression}"/>"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="roadDefect.contact.block"/>
</th>
<td>
<spring:bind path="roadDefect.contact.block">
<input type="text" maxlength="20" width="100%" size="20"
id="<c:out value="${status.expression}"/>"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="roadDefect.contact.floor"/>
</th>
<td>
<spring:bind path="roadDefect.contact.floor">
<input type="text" maxlength="20" width="100%" size="20"
id="<c:out value="${status.expression}"/>"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</td>
</tr>
<tr>
<th>
<mcaps:label key="roadDefect.contact.unit"/>
</th>
<td>
<spring:bind path="roadDefect.contact.unit">
<input type="text" maxlength="5" width="100%" size="20"
id="<c:out value="${status.expression}"/>"
name="<c:out value="${status.expression}"/>"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?