How to start a certain tabindex tab (primefaces)?

Asked

Viewed 630 times

0

How do I display one on a particular tab? I tried to use the tabIndex="#{meuBean.tabIndex}"setando for 0,1,2 and etc, but when opening it always positions in the first tab.

1 answer

1


Use:

PF('suaTabView').select(1);

Ex:

<p:commandButton onclick="PF('tabViewEdit').select(0);" />

Or you can activate the tab via an attribute in the Managed Bean

<p:tabView activeIndex="${meuMB.tabAtiva}" >  
  • 1

    Nilson in case I need the value to come from the bean because I’m coming from another page for a specific tab. The user selects a certain information on a page and when loading the tab (another page) I would like to open it automatically.

  • See if the new example works

  • I made the adjustments and it worked. Thanks!

Browser other questions tagged

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