我有一个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>

最佳答案

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

关于java - 如何在JavaScript中启动Spring WebFlow过渡,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12270039/

10-13 03:34