TabView on Primefaces with Ajax

2

Next, I have a small problem, but I'm following the same steps as the primefaces showcase, but without success.

I want to trigger an ajax every time a tab is selected, clicked. This way I will have what was the selected tab and if the user press f5, I will have the value of the last tab stored in some variable and it will not go to a different tab unless it clicks on the new tab. p>

However, when placing ajax with the event="tabChange" the tabs are stuck and even if you click on another tab there is no change.

Follow the code:

<p:tabView activeIndex="#{gerenciadorUsuarioView.controllerTabs}" id="tabViews">
            <p:ajax event="tabChange" listener="#{gerenciadorUsuarioView.tabChange}" />
            <ui:include src="include/estagiario.xhtml"/>

            <ui:include src="include/gestores.xhtml"/>

        </p:tabView>

In the UserControlView class:

public void tabChange(TabChangeEvent event){
    this.controllerTabs = event.getTab().getId();
}

I have tried to pass in the listener, after tabChange, an (event) tbm, but without a positive result.

I have already made a slight debug and do not call the method.

Will it be the version of primefaces? Thanks in advance for any help!

    
asked by anonymous 13.10.2016 / 21:05

0 answers