Package dyntabs

Class BaseDyntabCdiBean

java.lang.Object
dyntabs.BaseDyntabCdiBean
All Implemented Interfaces:
DyntabBeanInterface, Serializable

public class BaseDyntabCdiBean extends Object implements Serializable, DyntabBeanInterface
Base implementation of DyntabBeanInterface for CDI-managed tab beans.

Provides default implementations for tab lifecycle methods, event handling, inter-tab messaging, view navigation within a tab, and dialog management. Application-specific tab beans should extend this class.

Key features:

Author:
DynTabs
See Also:
  • Field Details

    • log

      protected static final org.slf4j.Logger log
  • Constructor Details

    • BaseDyntabCdiBean

      public BaseDyntabCdiBean()
  • Method Details

    • init

      @PostConstruct public void init()
      Specified by:
      init in interface DyntabBeanInterface
    • getParameters

      public Map getParameters()
      Specified by:
      getParameters in interface DyntabBeanInterface
    • isMainContentRendered

      public boolean isMainContentRendered()
    • setMainContentRendered

      public void setMainContentRendered(boolean value)
    • isErrPageRendered

      public boolean isErrPageRendered()
    • setErrPageRendered

      public void setErrPageRendered(boolean value)
    • setErrMsg

      public void setErrMsg(String msg)
    • getErrMsg

      public String getErrMsg()
    • observeDynTabEvent

      public void observeDynTabEvent(DynTabCDIEvent dynTabEvent)
      Receives DynTab lifecycle events (dynTabAdded, dynTabRemoved, dynTabSelected).

      This is NOT a CDI @Observes method! It is called directly from DynTabManager.fireDynTabEvent(dyntabs.DynTabCDIEvent) which iterates through all active tabs, sets the correct TabScope for each tab, and calls this method on the corresponding bean.

      Why not CDI @Observes? CDI can only see beans in the currently active tab scope. If tab r1 is active and HomeBean exists in r0, CDI would create a NEW HomeBean instance in r1 (wrong!) instead of using the existing one from r0.

      Specified by:
      observeDynTabEvent in interface DyntabBeanInterface
      Parameters:
      dynTabEvent - the tab lifecycle event to handle
    • onDynTabAdded

      protected void onDynTabAdded(DynTabCDIEvent event)
    • onDynTabRemoved

      protected void onDynTabRemoved(DynTabCDIEvent event)
    • onDynTabSelected

      protected void onDynTabSelected(DynTabCDIEvent event)
    • onThisTabSelected

      protected void onThisTabSelected()
    • observeApplicationEvent

      public void observeApplicationEvent(ApplicationCDIEvent appEvent)
      Receives application events (inter-tab communication). Called directly from DynTabManager - same reason as observeDynTabEvent(dyntabs.DynTabCDIEvent).
      Specified by:
      observeApplicationEvent in interface DyntabBeanInterface
    • onApplicationMessage

      protected void onApplicationMessage(String senderId, Object payload)
    • onJobFlowReturn

      protected void onJobFlowReturn(String senderId, Object jobFlowReturnValue)
    • sendMessageToAppModule

      public void sendMessageToAppModule(String targetAppModuleId, Object payload)
      Sends a message to another app module (DynTab) via DynTabManager. Uses DynTabManager.fireApplicationEvent(dyntabs.ApplicationCDIEvent) which iterates through tabs directly instead of the CDI @Observes mechanism.
    • closeAndReturnValueToCaller

      public void closeAndReturnValueToCaller(Object returnValue)
    • closeAndSelectCaller

      public void closeAndSelectCaller()
    • closeCurrentTab

      public void closeCurrentTab()
    • getCallerID

      public String getCallerID()
      the callerID is a special param, signaling that this JobFlow is called from another JobFlow This is a uniqueIdentifier of calling JobFlow
      Returns:
    • sendMessageToAllAppModules

      public void sendMessageToAllAppModules(Object payload)
    • getUniqueIdentifier

      public String getUniqueIdentifier()
      Specified by:
      getUniqueIdentifier in interface DyntabBeanInterface
    • callViewActivity

      public void callViewActivity(String viewActivity)
      Specified by:
      callViewActivity in interface DyntabBeanInterface
    • setAccessDenied

      public void setAccessDenied(boolean accessDenied)
    • accessPointMethod

      protected void accessPointMethod(Map parameters)
      Called when the tab is opened. Subclasses override this for custom initialization logic.
    • callAccessPointMethod

      public void callAccessPointMethod()
      Wraps accessPointMethod(java.util.Map) with error handling.

      Note: This method is NOT called for initial tabs (loaded during startup), because those do not go through DynTabManager.addTab(). This is acceptable since initial tabs are visible to everyone.

      Cannot be final because CDI interceptors need to proxy it.

      Specified by:
      callAccessPointMethod in interface DyntabBeanInterface
    • callMethodActivity

      public void callMethodActivity(String oldViewActivity, String newViewActivity)
      Specified by:
      callMethodActivity in interface DyntabBeanInterface
    • setActive

      @Deprecated public void setActive(boolean active)
      Deprecated.
      The active flag is no longer needed for @TabScoped beans since the bean is destroyed together with the tab. Kept for compatibility.
      Specified by:
      setActive in interface DyntabBeanInterface
    • getActive

      @Deprecated public boolean getActive()
      Deprecated.
      The active flag is no longer needed for @TabScoped beans.
      Specified by:
      getActive in interface DyntabBeanInterface
    • exitPointMethod

      protected void exitPointMethod(Map parameters)
      Called when the tab is closed. Subclasses override this for custom cleanup logic.
    • callExitPointMethod

      public void callExitPointMethod()
      Specified by:
      callExitPointMethod in interface DyntabBeanInterface
    • getDynTabId

      public String getDynTabId()
      Specified by:
      getDynTabId in interface DyntabBeanInterface
    • setDynTab

      public void setDynTab(DynTab dt)
      Specified by:
      setDynTab in interface DyntabBeanInterface
    • getDynTab

      public DynTab getDynTab()
      Specified by:
      getDynTab in interface DyntabBeanInterface
    • removeAppendToBodyElement

      protected void removeAppendToBodyElement(String id)
    • hideWidgetInDynTab

      public String hideWidgetInDynTab(String compId)
    • showWidgetInDynTab

      public String showWidgetInDynTab(String compId)
    • filterTableInDynTab

      public String filterTableInDynTab(String tableId)
    • clearTableFiltersInDynTab

      public String clearTableFiltersInDynTab(String tableId)