当用户更改选择框中的值时,我想触发流量更改:
<select>
<options>
<option>1</option>
<option>2</option>
</options>
</select>
阅读本文档后:https://docs.spring.io/spring-webflow/docs/current/reference/html/spring-mvc.html#spring-mvc-resuming-on-event我没有找到答案。请任何人帮忙吗?任何建议表示赞赏
我想要实现的改变是在从选择框中选择值时将按钮设置为激活。
有两种方法可以做到这一点:
首先,严格使用javascript(全部在UI中),通过onchange和/或onclick选择元素来查找按钮并激活/停用它
二,使用Webflow:
假设你想在这里使用webflow,你可以使用:
JSP
<form id="myFormId" action="${flowExecutionUrl}" method="post">
<select id="mySelectId" onchange="Spring.remoting.submitForm('mySelectId', 'myFormId', {fragments:'body', _eventId: 'myChangeEvent'}); return false;">
...
</select>
</form>
流
<view-state id="myViewStateId">
<transition on="myChangeEvent" validate="false" bind="true">
<!-- change some property to enable your button -->
</transition>
</view-state>
这将重新渲染视图,并且将更新您用于启用/禁用按钮的属性/属性。使用validate="false"
非常重要,否则验证错误可能会阻止您的成功转换