我有温泉Web Flow的一个问题。 如果表单上的用户点击提交按钮,我会在我的豆正确的价值观。
示例性字段将是雄性或雌性。 但是,我加入一个AjaxEventDecoration做对性下拉框这实在是一个形式的变化提出:选择并在bean我将获得值“性”,这是elementId。 下面是我的代码,你可以请审视一下,让我知道你在想什么?我需要尽快解决这个值...
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<style type="text/css" media="screen">
@import url("<c:url value="/resources/dojo/resources/dojo.css"/>");
@import url("<c:url value="/resources/dijit/themes/claro/claro.css"/>");
</style>
<script djconfig="parseOnLoad: true"
src="<c:url value="/resources/dojo/dojo.js"/>" type="text/javascript"></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>
<script type="text/javascript">dojo.require("dojo.parser");</script>
<html>
<head>
<title>Spring 3.0 MVC - Web Flow Example</title>
</head>
<body class="claro">
<h2>Dropdown Test</h2>
<form:form commandName="customer" id="customer">
<input type="hidden" name="_flowExecutionKey"
value="${flowExecutionKey}" />
<div id="container">
<table>
<tr>
<td><font color=red><form:errors path="sex" /></font><b>Sex:</b></td>
<td><form:select path="sex" id="sex">
<form:option value="MALE" label="MALE" />
<form:option value="FEMALE" label="FEMALE" />
</form:select>
<script type="text/javascript">
Spring.addDecoration(new Spring.ElementDecoration({
elementId : "sex",
widgetType : "dijit.form.Select",
widgetAttrs : {
promptMessage : "Enter Sex",
required : true }}));
</script></td></tr>
</table>
</div>
<input type="submit" name="_eventId_submit" id="submit" value="Submit" />
<input type="submit" name="_eventId_cancel" value="Cancel" />
<p>
<script type="text/javascript">
Spring.addDecoration(new Spring.ValidateAllDecoration({
elementId : 'submit',
event : 'onclick'
}));
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "sex",
event: "onChange",
formId:"customer",
params: {fragments:"body", _eventId: "loadSchools"}}));
</script>
</form:form>
</body>
</html>