在 Spring Web Flow 中,如何将 # 添加到 flowExecutionKey 的末尾以重定向到页面中的锚点?
基本上我想在流程执行键的末尾添加一个 #
例如 _flowExecutionKey=_c8CEAE6.....E1095#
这样当页面显示时它将显示在锚标记处
我有一个页面它是由用户动态构建的。
用户可以选择向页面添加其他字段以输入更多数据。
字段是存储在列表中的对象。
该页面循环遍历列表中的所有对象并显示它们。
我配置了一个操作流程,将另一个对象添加到列表中,然后再次显示页面,这会导致出现新字段。
问题是,当页面再次加载时,它始终位于顶部,而不是添加新字段的位置。我可以在生成新字段的位置添加一个锚点,但我不知道是否可以在流程执行键的末尾添加 #
Basically I want to add a # to the end of the flow execution key
e.g. _flowExecutionKey=_c8CEAE6.....E1095#
so that when the page displays it will display at the anchor tag
I have a page which is built dynamically by the user.
The user can choose to add additional fields to the page to enter more data.
The fields are an object which is stored in a list.
The page loops over all objects in the list and displays them.
I have configured an action flow that adds another object to the list and then displays the page again which causes the new fields to appear.
The problem is that when the page loads again it is always at the top and not where the new field was added. I can add an anchor to where the new fields are generated but I don't know if its possible to add a # to the end of the flow execution key
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有点遥远,但我认为解决这个问题的方法可能是通过步骤的组合,而不是通过 spring web-flow 机制
有一些 javascript,“onload”将位置更改为右侧锚点:
body onload="location.href = location.href + '#object8'"
这会将您带到第 8 个元素,而无需再次访问服务器。
A bit of a longshot, but I think the solution for this is probably through a combination of steps, and not so much through spring web-flow mechanisms
have a bit of javascript, that 'onload' changes the location to the right anchor:
body onload="location.href = location.href + '#object8'"
This would take you to the 8th element, without hitting the server again.
如果您使用表单,有比使用 javascript 更好的解决方案。
您可以像这样使用锚点:
结合在工作流程中设置属性:
在 jsp 的顶部:
因此,如果您提交保存操作,屏幕将自动跳转到“您的内容已保存”消息。
If you use forms, there is a better solution than working with javascript.
You can use anchors like this:
In combination with setting an attribute in the workflow:
On top in your jsp:
So if you submit your save action, the screen will automatically jump to the "Your thingy is saved" message.