代码之家  ›  专栏  ›  技术社区  ›  Pascal

Primefaces更改延迟输出面板内inputSwitch的值

  •  0
  • Pascal  · 技术社区  · 7 年前

    我们正在使用JSF和Primefaces控制Tomcat上运行的Web应用程序中的SparkStream。当我们启动或停止此流时,Web GUI持续加载大约需要15秒。

    现在,我们希望对长时间加载内容使用延迟加载,以确保即使Bean需要一些时间来响应,Web GUI仍然可以访问。无论如何,如果我们这样做,我们的p:inputSwitch就不能正常工作了。 每次加载或刷新页面时,Bean中的值都设置为false。

    <h:form>
      <p:panel id="control" header="Streaming-Control" collapsed="false" toggleable="true">
        <p:outputPanel deferred="true">
          <p:inputSwitch id="test" value="#{SomeBean.someBoolean}">
            <p:ajax update="test"/>
          </p:inputSwitch>      
        </p:outputPanel>
      </p:panel>
    </h:form>
    

    我们需要将inputSwitch放在延迟的outputPanel中,因为在整个页面完全呈现之前,它不应该被访问(这意味着流正在运行或停止,但不是启动或停止atm)。 PrimeFaces版本为6.0。

    1 回复  |  直到 7 年前
        1
  •  0
  •   tandraschko    7 年前

    始终尝试最新版本;) 它可能已经被修复了: https://github.com/primefaces/primefaces/issues/2912