com.icesoft.faces.component.menupopup

## Class MenuContextEvent

- java.lang.Object
- - java.util.EventObject
  - - javax.faces.event.FacesEvent
    - - com.icesoft.faces.component.menupopup.MenuContextEvent

- All Implemented Interfaces:
    java.io.Serializable

      public class MenuContextEvent
      extends javax.faces.event.FacesEvent

  A MenuContextEvent encapsulates the information about which UIComponent was context-clicked on by the user, in order to display the menuPopup, and thus, on which UIComponent actions should be taken.

  The source UIComponent, for this event, has a menuContext attribute, which is how it specified to receive MenuContextEvents.

  Unlike most FacesEvents, which are queued up, and sent via MethodBindings, at the end of whichever phase, MenuContextEvent is set via ValueBindings during the Apply Request Values phase, while UIData, or other containers, are iterating over their children, so that bean code can use MenuContextEvent.getComponent() to access any row specific information it needs. The Apply Request Values phase is used, so that the MenuContextEvent data is available to the bean, before the MenuItem actionListener is called, which is in the Invoke Application phase, or at the end of the Apply Request Values phase, if immediate="true".

  MenuContextEvent provides context for a specific component in the hierarchy, but there can be several levels for which contextual information is necessary. If there are nested dataTables, then context will be needed for each dataTable, as well as the columns. To facilitate this, each MenuContextEvent is a part of a double-linked-list of MenuContextEvents, which together provide the complete context. Bean code can process each MenuContextEvent separately, in its own listener method, or process the terminal MenuContextEvent, and follow its outer references, all within a single method.

  Author:
    Mark Collette
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.EventObject

      `source`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MenuContextEvent` | `getInner()` The inner MenuContextEvent is the event corresponding to the source UIComponent that is the nearest child of this event's source UIComponent, for which there is a menuContext attribute.
    `MenuContextEvent` | `getOuter()` The outer MenuContextEvent is the event corresponding to the source UIComponent that is the nearest parent of this event's source UIComponent, for which there is a menuContext attribute.
    `boolean` | `isAppropriateListener(javax.faces.event.FacesListener facesListener)` MenuContextEvent is not enqueued and broadcast, so this is not relevant
    `boolean` | `isTerminal()` A MenuContextEvent is terminal if it is the inner-most event providing context for which UIComponent was context-clicked on by the user, in order to display the menuPopup.
    `void` | `process(javax.faces.context.FacesContext facesContext)`
    `void` | `processListener(javax.faces.event.FacesListener facesListener)` MenuContextEvent is not enqueued and broadcast, so this is not relevant

    - ### Methods inherited from class javax.faces.event.FacesEvent

      `getComponent, getPhaseId, queue, setPhaseId`

    - ### Methods inherited from class java.util.EventObject

      `getSource, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getOuter

          public MenuContextEvent getOuter()

      The outer MenuContextEvent is the event corresponding to the source UIComponent that is the nearest parent of this event's source UIComponent, for which there is a menuContext attribute.
      Returns:
        Outer MenuContextEvent

    - #### getInner

          public MenuContextEvent getInner()

      The inner MenuContextEvent is the event corresponding to the source UIComponent that is the nearest child of this event's source UIComponent, for which there is a menuContext attribute.
      Returns:
        Outer MenuContextEvent

    - #### isTerminal

          public boolean isTerminal()

      A MenuContextEvent is terminal if it is the inner-most event providing context for which UIComponent was context-clicked on by the user, in order to display the menuPopup.
      Returns:
        If this MenuContextEvent is terminal

    - #### process

          public void process(javax.faces.context.FacesContext facesContext)

    - #### isAppropriateListener

          public boolean isAppropriateListener(javax.faces.event.FacesListener facesListener)

      MenuContextEvent is not enqueued and broadcast, so this is not relevant
      Specified by:
        `isAppropriateListener` in class `javax.faces.event.FacesEvent`

    - #### processListener

          public void processListener(javax.faces.event.FacesListener facesListener)

      MenuContextEvent is not enqueued and broadcast, so this is not relevant
      Specified by:
        `processListener` in class `javax.faces.event.FacesEvent`

Copyright 2025 ICEsoft Technologies Canada, Corp. All Rights Reserved.