Yashar
Yashar

Reputation: 1162

Cannot change tabs on tabPanel by clicking on the tabs in richfaces 4

I am using tabPanels whith "onheaderclick" attribute as follows

            <rich:tabPanel id="integrationCenterTabPanel" activeItem="#{integrationCentralOverviewAction.activeTab}" switchType="ajax">
            <a4j:jsFunction name="clearSelections"
                            action="#{integrationCentralOverviewAction.clearSelections}"
                            />

                <rich:tab id="invoiceTab" header="#{messages.invoices}"
                    immediate="true" name="invoiceTab" onheaderclick="clearSelections();">

*************
*************
</rich:tab>
                <rich:tab id="customerTab" header="#{messages.customers}"
                    immediate="true" name="customerTab" onheaderclick="clearSelections();">
***************
**************
</rich:tab>

and I cannot switch between my tabs by clicking on the headers, it is working fine when I remove onheaderclick attribute. What am I doing wrong here!

Upvotes: 1

Views: 1105

Answers (1)

L-Ray
L-Ray

Reputation: 1647

You actually try to do two Ajax-Requests simultaniously:

  • do the clearSelections via ajax
  • load the new tab via ajax

Because ajax is handled asynchroniously, this will be the reason.

You can either try to change the rich:tabs switchType to switchType="client"orswitchType="server"` (Ajax will be gone) or add the selectionClearing as a changeListener to the rich:tabPanel. This may look something like e.g. (untested):

<rich:tabPanel ... 
   itemChangeListener="#{integrationCentralOverviewAction.clearSelections}"/>

Hope it helps...

Upvotes: 1

Related Questions