Source code for /src/jsp/bamboo_admin_edit0.jsp
//======================================================================//
// Author: Mark Qian <markqian@hotmail.com> //
// WWW: http://www.coolshare.com //
// Copyright (c) 2006, Mark Qian //
// //
// You must contact Mark Qian to get a permission of use //
// in case you want to make any use of the codes except viewing it //
// on Mark's site. //
//======================================================================//
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<link href="/springapp/css/main.css" rel="stylesheet" type="text/css" />
<head><title><fmt:message key="title"/></title>
<script language="javascript" src="/springapp/js/ajax.js"></script>
<script language="javascript" src="/springapp/js/cross_browser.js"></script>
<script language="javascript" src="/springapp/js/_debugger.js"></script>
<script type="text/javascript">
djConfig = { isDebug: true };
</script>
<script type="text/javascript" src="/springapp/js/dojo/dojo.js"></script>
<script type="text/javascript">
dojo.require("dojo.event.*");
dojo.addOnLoad(init);
function init() {
dojo.event.connect(document.getElementById("show"), "onclick", window, "handleSource");
dojo.event.connect(document.getElementById("sourceName"), "onchange", window, "loadSource");
dojo.event.topic.subscribe("/save", window, "doSave");
dojo.event.topic.registerPublisher("/save", document.getElementById("buttonSave"), "onclick");
doOnload();
}
function doOnload() {
if (top.list && top.list.sel)
document.getElementById("buttonSave").disabled = false;
}
function doSave() {
var f = document.getElementById("booForm");
f.target="list";
f.submit();
}
function handleSource(e) {
var c = getSrcElement();
var d = document.getElementById("source");
if (c.checked) {
d.style.display = "block";
} else {
d.style.display = "none";
}
}
var shttp;
function loadSource(e) {
var c = getSrcElement();
var id = c.value;
var para = "id="+id;
shttp = createRequestObject();
shttp.onreadystatechange = function () {
if(shttp.readyState == 4){
var d = document.getElementById("source");
d.innerHTML = shttp.responseText;
}
};
shttp.open('POST', "/springapp/getSource.htm?jsp=getSource0", true);
shttp.setRequestHeader("Content-length", para.length);
shttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
shttp.setRequestHeader("Connection", "close");
shttp.send(para);
}
</script>
</head>
<body background = "/RemoteScriptGuru/html/coolshare/html/images/rulebk2.jpg">
<div><input type="button" value="Save" id="buttonSave" disabled="disabled"></div>
<form:form id="booForm" action="/springapp/bambooAdminEdit0.htm">
<input type=hidden name="id" id="id" value="<c:out value="${bambooAdminEditForm.bambooId}"/>">
<fieldset>
<legend>Bamboo Data</legend>
<label for="bambooName" accesskey="f">Name:</label>
<input type="text" name="bambooName" id="bambooName" size="20" maxlength="64" value="<c:out value="${bambooAdminEditForm.bambooName}"/>">
<label for="bambooPrice" accesskey="l">Price:</label>
<input type="text" name="bambooPrice" id="bambooPrice" size="20" maxlength="64" value="<c:out value="${bambooAdminEditForm.bambooPrice}"/>">
<br>
<label for="bambooSize" accesskey="e">Size:</label>
<input type="text" name="bambooSize" id="bambooSize" size="20" maxlength="128" value="<c:out value="${bambooAdminEditForm.bambooSize}"/>">
<label for="bambooQuantity" accesskey="p">Quantity:</label>
<input type="text" name="bambooQuantity" id="bambooQuantity" size="10" maxlength="10" value="<c:out value="${bambooAdminEditForm.bambooQuantity}"/>">
<br>
<label for="bambooHeight" accesskey="e">Height:</label>
<input type="text" name="bambooHeight" id="bambooHeight" size="20" maxlength="128" value="<c:out value="${bambooAdminEditForm.bambooHeight}"/>">
<label for="bambooType" accesskey="p">Type:</label>
<input type="text" name="bambooType" id="bambooType" size="10" maxlength="10" value="<c:out value="${bambooAdminEditForm.bambooType}"/>">
<br>
<label for="bambooLight" accesskey="e">Light:</label>
<input type="text" name="bambooLight" id="bambooLight" size="20" maxlength="128" value="<c:out value="${bambooAdminEditForm.bambooLight}"/>">
<label for="show" accesskey="p">Show Source:</label>
<input type="checkbox" id="show" size="10" maxlength="10" checked="ture">
</fieldset>
<br>
<div id="source">
<%@ include file="source0.jsp" %>
</div>
</form:form>
</body>
</html>