Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>in your xhtml you are calling listener="#{promotionDetailBean.<strong>onTabChange</strong>}" but in your bean the method name is "public void <strong>tabChanged</strong>". So it cannot trigger.</p> <p>I have tried an example on prime-showcase at:</p> <p><strong>in bean (TabBean):</strong></p> <pre><code>private Integer activeTabIndex = 1; // setter/getter public void onTabChange(TabChangeEvent event) { FacesMessage msg = new FacesMessage("Tab Changed", "Active Tab: " + event.getTab().getTitle()); TabView tabView = (TabView) event.getComponent(); int activeTabIndex = tabView.getActiveIndex(); System.out.println("--------" + activeTabIndex); FacesContext context = FacesContext.getCurrentInstance(); Map&lt;String, String&gt; params = context.getExternalContext().getRequestParameterMap(); String activeIndexValue = params.get(tabView.getClientId(context) + "_activeIndex"); System.out.println("--------" + activeIndexValue); context.addMessage(null, msg); } </code></pre> <p><strong>in xhtml (tabviewChangeListener.xhtml):</strong></p> <pre><code>&lt;p:tabView id="tabView" dynamic="true" activeIndex="#{tabBean.activeTabIndex}"&gt; &lt;p:ajax event="tabChange" listener="#{tabBean.onTabChange}" update=":form:growl"/&gt; &lt;p:tab title="Godfather Part I" id="Godfather1"&gt; </code></pre> <p><strong>The result is as expected:</strong> At beginning the second tab is displayed. I click first tab and then third. sysout is:</p> <p>--------0</p> <p>--------0</p> <p>--------2</p> <p>--------2</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload