Package dyntabs

Class TabNavigationHandler

java.lang.Object
jakarta.faces.application.NavigationHandler
jakarta.faces.application.ConfigurableNavigationHandler
org.primefaces.application.DialogNavigationHandler
dyntabs.TabNavigationHandler

public class TabNavigationHandler extends org.primefaces.application.DialogNavigationHandler
Custom JSF NavigationHandler that intercepts navigation outcomes containing a colon (":") to open dynamic tabs instead of performing standard page navigation.

When an action outcome contains a colon, the part before the colon is treated as a standard navigation outcome (typically the shell page), and the part after the colon is used as the tab name to open via DynTabManager.launchTab(String).

Example usage in XHTML:

 
 <!-- Opens the "Users" dynamic tab -->
 <p:menuitem value="Users" action="uishell:Users" />

 <!-- Opens the "Products" dynamic tab -->
 <p:menuitem value="Products" action="uishell:Products" />
 
 

This handler extends PrimeFaces DialogNavigationHandler, so standard JSF navigation and PrimeFaces dialog navigation both continue to work normally when the outcome does not contain a colon.

Registration: Configure in faces-config.xml:

 
 <application>
     <navigation-handler>dyntabs.TabNavigationHandler</navigation-handler>
 </application>
 
 
Author:
DynTabs
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    TabNavigationHandler(jakarta.faces.application.ConfigurableNavigationHandler base)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleNavigation(jakarta.faces.context.FacesContext facesContext, String action, String outcome)
    Handles JSF navigation.

    Methods inherited from class org.primefaces.application.DialogNavigationHandler

    getNavigationCase, getNavigationCases

    Methods inherited from class jakarta.faces.application.ConfigurableNavigationHandler

    getNavigationCase, inspectFlow, performNavigation

    Methods inherited from class jakarta.faces.application.NavigationHandler

    handleNavigation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TabNavigationHandler

      public TabNavigationHandler(jakarta.faces.application.ConfigurableNavigationHandler base)
  • Method Details

    • handleNavigation

      public void handleNavigation(jakarta.faces.context.FacesContext facesContext, String action, String outcome)
      Handles JSF navigation. If the outcome contains a colon, the part after it is used as a tab name to open via DynTabManager.launchTab(String). Otherwise, delegates to the standard PrimeFaces dialog navigation handler.
      Overrides:
      handleNavigation in class org.primefaces.application.DialogNavigationHandler
      Parameters:
      facesContext - the current FacesContext
      action - the action expression that triggered navigation
      outcome - the navigation outcome (e.g. "uishell:Users")