不从View中删除组件为什么?

时间:2015-07-17 07:26:10

标签: jsf jsf-2

我使用下面的代码来删除代码并从头开始重新加载,但是JSF无法从树中删除组件,并且在单击按钮后显示相同的方法。

 public String collapseTreeById(ActionEvent event) throws IOException {
     String treeId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("treeId");
     UITree tree = (UITree)event.getComponent().findComponent(treeId);
     tree.getParent().getChildren().clear();

     return null;
 }

但是我能够在JSF页面中查看与数据相同的组件。任何人可以帮我解决什么问题?在按下该按钮之前按下按钮后,它显示处于相同状态的页面。

1 个答案:

答案 0 :(得分:0)

我不是JSF专家,你的想法听起来有点奇怪,但也许可以在树的支持bean中尝试组件绑定?

相关问题