2

我想创建带有进度条的选项卡。像这样的东西:

<p:tabView id="tabs" dynamic="true" cache="false">
    <p:tab id="tab1" title="tab1" >
        <ui:include src="tab1.xhtml" />
    </p:tab>
    <p:tab id="tab2" title="tab2" >
        <ui:include src="tab2.xhtml" />
    </p:tab>

    <p:blockUI block="tabs" trigger="tabs">  
        LOADING
    </p:blockUI>  
</p:tabView>

但它不起作用。你能帮我纠正我的错误吗?

4

2 回答 2

4

尝试这个:

<p:tabView id="tabs">

  <p:ajax event="tabChange" onstart="BUI.show()" oncomplete="BUI.hide()" />

  <p:tab id="tab1" title="tab1">
    <h:outputtext value="TAB 1" />
  </p:tab>

  <p:tab id="tab2" title="tab2">
    <h:outputtext value="TAB 2" />
  </p:tab>

</p:tabView>

<p:blockUI widgetVar="BUI" block="tabs">
  LOADING
</p:blockUI>
于 2012-10-16T11:44:45.440 回答
0

以下代码对我有用(Primefaces 5.2)

<p:blockUI block="tabs" widgetVar="tabsBlocker">  
    LOADING
</p:blockUI>  

<p:tabView id="tabs" dynamic="true" cache="false" 
    onTabChange="PF('tabsBlocker').show()" 
    onTabShow="PF('tabsBlocker').hide()">

  <p:tab id="tab1" title="tab1" >
      <ui:include src="tab1.xhtml" />
  </p:tab>

  <p:tab id="tab2" title="tab2" >
      <ui:include src="tab2.xhtml" />
  </p:tab>

</p:tabView>
于 2015-07-31T12:34:18.017 回答