使用ZK Tree组件,如何从Treechildren节点中删除Treeitems
有谁知道如何从ZK中的Treechildren节点中删除Treeitems?我尝试过使用迭代器和removeChild,但出现ConcurrentModificationException!
List<Treeitem> myTreeItems = treechildren.getChildren();
Iterator<Treeitem> iterator = myTreeItems.iterator();
while (iterator.hasNext()){
myItem = (Treeitem)iterator.next();
parent.removeChild(myItem);
}
有什么想法吗?
Does anyone know how to remove Treeitems from a Treechildren node in ZK? I have tried using an iterator and removeChild but a ConcurrentModificationException!
List<Treeitem> myTreeItems = treechildren.getChildren();
Iterator<Treeitem> iterator = myTreeItems.iterator();
while (iterator.hasNext()){
myItem = (Treeitem)iterator.next();
parent.removeChild(myItem);
}
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不是删除项目的正确方法,您需要执行类似的操作。
这将提供您需要的功能!
有关使用 Tree 组件的更多详细信息,请参阅此处。
That is not the correct way to remove the items, you need to do something like this.
This will provide the functionality that you require!
More details on using the Tree component are available here.
正如我在您的案例中看到的,您想要删除所有附加在
treechildren
上的组件。我认为最快的方法是:
像
java.util.List
一样操作结果。As what I saw in your case you want to remove all components which are all attached on a
treechildren
.I think the fastest way is:
just operate the result like a
java.util.List
.