【发布时间】:2015-07-22 13:13:50
【问题描述】:
我正在尝试下面的代码
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;
}
在这里你可以检查我已经删除了组件的所有子组件,并且这个方法是这样调用的
<a4j:commandLink actionListener="#{inventoriesBean.collapseTreeById}"
value="collapse" render="treeServType">
<f:param value="treeServType" name="treeId" />
</a4j:commandLink>
还添加了render,但我仍然看到树处于相同状态(与先前状态没有变化)并且没有再次创建。如果渲染不再创建组件并更新模型值,那么即使树状态也应该改变?它也没有发生。
为什么?
【问题讨论】:
-
a4j命名空间究竟代表了什么? -
富脸组件
-
我没有看到
a4j:commandLink(docs.jboss.org/richfaces/latest_3_3_X/en/tlddoc/a4j/…) 的任何render属性 -
这是第 n 次有人从您的问题标题中删除标签(我们已经有一个完整的单独标签部分,它非常有用)。您能否以此为暗示,在您以后的问题中不再这样做?谢谢。
-
在旧的 Jboss4 中是
reRender,它的电话是render