Tabview in Primefaces with Ajax

Asked

Viewed 533 times

2

Next, I have a small problem, but I am following the same steps of the showcase of the first faces, but without success.

I want you to fire an ajax every time a tab is selected, clicked. That way I’ll have which tab was selected and if the user presses F5, I’ll have the value of the last tab stored in some variable and it won’t go to a different tab, unless he clicks on the new tab.

However, when placing ajax with Event="tabChange" tabs get stuck and even clicking on another tab does not change.

Follows 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 Managed class:

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

I already tried to pass in Istener, after the tabChange, a (Event) tbm, but without positive result.

I’ve done a slight debug and it doesn’t even call the method.

Will it be version of the first faces? I appreciate any help!

  • I don’t know if it helps, but I had problems with Tabview and couldn’t change the index for the component, I had to do a function in the bean to change the activeIndex http://answall.com/a/167348/60946. It might be a bug of the first faces.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.