程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确?

开发过程中遇到Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确的问题如何解决?下面主要结合日常开发的经验,给出你关于Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确的解决方法建议,希望对你解决Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确有所启发或帮助;

</b>在“有效”之后没有任何结束,但是</n>。 这些事情有时会导致奇怪的问题,例如您遇到的问题

修复它,然后再试一次

[编辑]我找到了一个解决方案给您pb:基本上删除您选择的装饰和AJAX事件,并以此方式进行操作:

<tr>
    <td><Font color=red><form:errors path="sex" /></Font><b>Sex:</b></td>
    <td><form:SELEct path="sex" ID="sex" required="true" data-dojo-type="dijit/form/SELEct" onchange="Spring.remoTing.submitForm('sex', 'customer', {fragments:'body', _eventID: 'loadSchools'}); return false;">
            <form:option value="MALE" label="MALE" />
            <form:option value="FEMALE" label="FEMALE" />
        </form:SELEct>
   </td>
</tr>

似乎选择装饰存在一些问题…我将尝试看看是否可以找到另一种方法,但是我对此进行了测试,并且可以正常工作

解决方法

我在Springs Web Flow中遇到问题。如果用户单击表单提交按钮,则我的bean 中将有 RIGHT 值。

例如,性别字段为MALE或FEMALE。但是,然后我添加了一个 AjaxEventDecoration
来对性别下拉框的更改进行提交,这实际上是一种 形式:SELEct, 并且在bean中,我将获得值 “ sex”
,即elementId。下面是我的代码,请您检查一下,让我知道您的想法&Hellip;我需要尽快解决此问题&Hellip;

<%@ 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>

大佬总结

以上是大佬教程为你收集整理的Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确全部内容,希望文章能够帮你解决Springs Web Flow问题。表单提交值正确,AjaxEventDecoration不正确所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。