如何使用 spring webflow 在浏览器刷新时强制执行转换
情况是这样的:在页面中我使用ajax向后端发送数据。这一切都工作正常,它将信息按其应有的方式存储在数据库中。现在,当我按浏览器上的刷新按钮时,它仍然包含旧数据(我不手动更新表单)。我认为这样做的原因是因为刷新不是流程的一部分,所以我的转换从未被触发。如何强制重新加载表单?你如何在 flow xml 中定义这样的?
下面是 webflow xml 的一部分
<action-state id="showProposal">
<evaluate expression="portfolioAction.showProposalFormAction" />
<transition on="success" to="showProposalView" />
</action-state>
<view-state id="showProposalView" view="/swf/proposal/proposal">
<transition on="storeProposal" to="storeProposalView" >
<evaluate expression="portfolioAction.storeProposalFormAction" />
</transition>
<transition on="applySelection" to="showProposalView">
<evaluate expression="portfolioForm.bindAndValidate" />
<evaluate expression="portfolioAction.showProposalFormAction" />
</transition>
</view-state>
Here is the situation: In a page I send data to the backend using ajax. This all works fine, it stores the information in the database as it should and all. Now when I press the refresh button on the browser, it still contains the old data (I don't update the form manually). The reason for this I think it is because my transition is never fired since the refresh is not part of the flow. How can I force reloading the form? How do you define such in the flow xml?
below is part of the webflow xml
<action-state id="showProposal">
<evaluate expression="portfolioAction.showProposalFormAction" />
<transition on="success" to="showProposalView" />
</action-state>
<view-state id="showProposalView" view="/swf/proposal/proposal">
<transition on="storeProposal" to="storeProposalView" >
<evaluate expression="portfolioAction.storeProposalFormAction" />
</transition>
<transition on="applySelection" to="showProposalView">
<evaluate expression="portfolioForm.bindAndValidate" />
<evaluate expression="portfolioAction.showProposalFormAction" />
</transition>
</view-state>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否将逻辑放在
view-state
的on-render
部分?Could you put your logic in the
on-render
section of yourview-state
?