0

我有一个 Spring WebFlow2 项目,如果用户单击“loadschools”提交按钮,我将调用我的控制器并加载状态,然后根据选中的单选按钮重新显示具有新状态的同一屏幕。如果用户单击单选按钮,我想删除“loadschool”提交按钮并运行 java 脚本。可以这样做吗?我如何告诉 webflow 过渡运行?

<view-state id="SchoolVisitReport" view="SchoolVisitReport.jsp" model="visit" >
 <transition on="submit" to="addVisit">
   <evaluate expression="flowActions.validateVisit(visit, messageContext)"/>
 </transition>
 <transition on="cancel" to="endState" bind="false"/>
 <transition on="loadSchools" to="SchoolVisitReport" >
    <evaluate expression="flowActions.initializeSelectableStates(visit)" result="flowScope.selectableStates"/>
 </transition>
</view-state>
4

2 回答 2

1

onchange='window.location="${flowExecutionUrl}&_eventId=loadSchools"'

于 2012-09-04T19:37:22.507 回答
0

对于您的第二个问题,请尝试

<script type="text/javascript">
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                        elementId : "radiobuttonId",
                        formId : "visitFormId",
                        event : "onChange",
                        params : {
                            _eventId : "loadSchools",
                            fragments : "body"
                        }
                    }));
                </script>

并查看表单是否被提交

于 2012-09-05T12:56:02.370 回答