-1

We have a tabPanel which has multiple tabs. When any event is performed in any of the tabs (e.g. click 'ajaxSubmit' button in tab1) all tabs are refreshed which is causing performance issues (e.g. getter of 'table' value is always invoked from tab3).

We tried to wrap the content of each tab in <a4j:region>, but the getters of components in tab3 are still invoked.

Please find the sample code snippet below:

<r:tabPanel id="tabWorkingPanel" styleClass="otTMcontainer" selectedTab="#{tabHandlerBean.activeTab}">
    <rich:tab id="tab1">
        <h:commandButton value="ajaxSubmit"/>
    </rich:tab>
    <rich:tab id="tab2" />
    <rich:tab id="tab3">
        <rich:dataTable id="table" value="#{bean.someValue}">...</rich:dataTable>
    </rich:tab>
</r:tabPanel>
halfer
  • 18,701
  • 13
  • 79
  • 158
susthan
  • 11
  • 2
  • 1
    Looks like you misunderstand the workings of `h:commandButton`. `h:commandButton` does not do ajax by default, and I'm not even altogether confident it works well with Richfaces components (richfaces has some oddity to it). Replace that command button with an `a4j:commandButton`, setting `execute="@this"` and `render="tab1"` – kolossus Apr 02 '15 at 15:48

1 Answers1

1

I think you should be using reRender so that only relevant tabs are refreshed. I think you should also wrap the contents of each tab in a form so that not everything is submitted on each submit, though perhaps that's what you were trying to do with region. I would carefully read the documentation to make sure you're using these correctly.

I have not used RichFaces, so I'm not positive this will work, but a similar approach works for PrimeFaces.

BalusC's description of process and update may be useful. He's discussing PrimeFaces, but I think the same concepts apply.

Community
  • 1
  • 1
DavidS
  • 4,384
  • 2
  • 23
  • 51