Spring WebFlow2 JavaScript沒有提交頁面?Spring WebFlow2 JavaScript未提交頁面?
我想使用WebFlow2附帶的Spring JavaScript來提交帶有過渡值的頁面,如果用戶單擊其中一個單選按鈕。我插入我的JavaScript,但頁面沒有得到提交點擊?
JSP:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
<head>
<title>Spring 3.0 MVC - Web Flow Example</title>
<script type="text/javascript"
src="<c:url value="/resources/dojo/dojo.js" />">
</script>
<script type="text/javascript"
src="<c:url value="/resources/spring/Spring.js" />">
</script>
<script type="text/javascript"
src="<c:url value="/resources/spring/Spring-Dojo.js" />">
</script>
<link type="text/css" rel="stylesheet"
href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" />
</head>
<body>
<h2>Customer Registration</h2>
<form:form commandName="customer" id="customer">
<input type="hidden" name="_flowExecutionKey"
value="${flowExecutionKey}" />
<table>
<tr>
<td><font color=red><form:errors path="name" /></font><b>Name:
</b></td>
<td><form:input path="name" id="name" /> <script
type="text/javascript">
Spring
.addDecoration(new Spring.ElementDecoration(
{
elementId : "name",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : {
promptMessage : "This is the name you would like entered into the system."
}
}));
</script> <br />
<p></td>
</tr>
<tr>
<td><font color=red><form:errors path="phoneNumber" /></font>
<b>Phone number: </b></td>
<td><form:input path="phoneNumber" id="phoneNumber" /><br />
<script type="text/javascript">
Spring
.addDecoration(new Spring.ElementDecoration(
{
elementId : "phoneNumber",
widgetType : "dijit.form.ValidationTextBox",
widgetAttrs : {
promptMessage : "This is the phone number for the above name"
}
}));
</script></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><b>Row:</b></td>
<td><form:radiobutton value="B" path="row" id="row" />Row: B<BR>
<form:radiobutton value="A" path="row" id="row" />Row: A<BR>
<script type="text/javascript">
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId : "row",
formId : "customer",
event : "onChange",
params : {
_eventId : "loadSchools",
fragments : "body"
}
}));
</script></td>
</tr>
</table>
<input type="submit" name="_eventId_proceed" value="proceed"
id="proceed" />
<script type="text/javascript">
Spring.addDecoration(new Spring.ValidateAllDecoration({
elementId : 'proceed',
event : 'onclick'
}));
</script>
<input type="submit" name="_eventId_cancel" value="Cancel" />
</form:form>
</body>
</html>
感謝,但我用的無線電按鈕,再次看起來它只適用於第一個單選按鈕 – PartyWithJohn
的第一次點擊,所以它的工作原理?你是否把onchange和onclick都裝上了,兩者都裝飾得很好? – rptmat57
NOOOO不工作....我把onchange和onclick,它只適用,如果你點擊第一個單選按鈕.... – PartyWithJohn