如何解决Ajax 导致不可见的 <rich:collapsibleSubTable>
我想在表格行上实现一个加号按钮,当点击该按钮时,会在其下方显示其他信息。
我们的 UIProfile 类有这两个方法:
private List<UIProfile> history = new LinkedList<>();
private boolean isExpanded = false;
这是 xhtml:
<a4j:commandLink render="profileHistory">
<h:graphicImage library="icons" name="obj16/plus.png" rendered="#{true}" style="vertical-align:middle; margin: 0px; padding:0px;" />
<a4j:ajax event="click" listener="#{entity.flipExpanded}" execute="@form" render="profileHistory"/>
</a4j:commandLink>
...
<rich:collapsibleSubTable id="profileHistory" value="#{entity.history}" expanded="#{entity.expanded}" var="hEntity">
...
</rich:collapsibleSubTable>
这是 flipExpanded 方法:
public void flipExpanded() {
isExpanded = !isExpanded;
if(isExpanded) {
final ProfileProvider provider = (ProfileProvider) this.provider;
provider.setExpanded(this); // This method stores the id of the profiles in Set to track what's open and what's not
provider.loadHistory(this); // This method queries and fill the List<UIProfile> history to show in the front end
}
}
经过大量调试,后端的数据似乎是一致的,但是rich:collapsibleSubTable总是display:none。
代码是否可能没有按照我期望的顺序执行? (我是 Richfaces 的新手)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。