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 (将#修改为@)