1

I use Primefaces tabView to be able to switch between tabs. When the user switches to certain tabs, I want to execute some code. Here is what I have so far:

.xhtml

<p:tabView id="tabsView" widgetVar="tabPanelWidget" dynamic="true" cache="true">
    <p:ajax event="tabChange" listener="#{backingView.onTabChange}" process="@none" update="@none" immediate="true"/>
        ....
</p:tabView>

backingView.java

public void onTabChange(TabChangeEvent event) throws IOException {
        if (event == null) return;
        ....
}

However, onTabChange() is only called the very first time I switch to a given tab. Reloading the page "resets" this, but I generally want the the function to be executed every time I switch tab. Any ideas?

Primefaces version: 6.2.17

Christian O.
  • 468
  • 2
  • 12
  • 1
    Change `process="@none"` to at least `process="@this"` – Jasper de Vries Mar 08 '22 at 08:20
  • 1
    Does this answer your question? [Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes](https://stackoverflow.com/questions/25339056/understanding-primefaces-process-update-and-jsf-fajax-execute-render-attributes) – Jasper de Vries Mar 08 '22 at 08:22
  • @JasperdeVries yes this has answered my question, sorry for the late response – Christian O. Mar 15 '22 at 15:21

0 Answers0