英文:
Apache Wicket - HTML5-details-element on Repeatingview - save open-property
问题
我有一个包含HTML5详细元素的重复视图。用户可以打开或折叠一些元素。如果我从重复视图中删除一些元素,然后通过target.add(container)重新加载重复视图,所有元素都会再次折叠。我该如何解决这个问题?是否有一种简单的方法来存储展开属性?
英文:
I have a repeatingview which contains HTML5 detail elements. The user can open or collapse some elements. If I remove some elements of the repeatingview and then reload the repeatingview by target.add(container), all elements are collapsed again. How can I solve this? Is there a simple way to store the open-Property?
答案1
得分: 2
当一个<detail>
元素被展示时,会向其添加一个open
属性。
您将需要将该状态持久化在某个地方:可以是在浏览器中(例如在cookie中或者直接在页面上的某些JS中),或者将其发送到服务器,这样Wicket可以渲染出这些open
属性。
英文:
When a <detail>
element is revealed, an open
attribute is added to it.
You will have to persist that state somewhere: in the browser (e.g. in a cookie or just in some JS on that page) or send it to the server so Wicket can render the open
attributes.
答案2
得分: 0
如果您在AjaxRequestTarget
中添加了RepeatingView
,但没有覆盖RepeatingView
对象的onConfigure()
方法,它将会重绘并呈现为第一次。请提供一些代码,以便我们可以查看问题发生的上下文。
英文:
If you are adding the RepeatingView
in an AjaxRequestTarget
but you are not overriding onConfigure()
method of RepeatingView
object, it will repaint and render as the first time it did.
Could you please provide some code so we can see in which context the issue is happening?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论