Class WindowListenerTag

  • All Implemented Interfaces:
    ConditionalTag, org.apache.commons.jelly.Tag

    public class WindowListenerTag
    extends EventListenerTag

    A specialized event listener tag that can be used to register window listeners.

    With this tag it is possible to link events triggered by a window to an action. The name of the action to be invoked must be specified as parameter. Optionally an event filter can be specified; the action is then only invoked if the window event is matched by the filter. There are no additional attributes other than the ones defined by the base class.

    Tags of this type must be nested inside a window tag or alternatively specify the targetBean attribute. The listener is registered at the window created by this window tag or at the target bean.

    Version:
    $Id: WindowListenerTag.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • WindowListenerTag

        public WindowListenerTag()
        Creates a new instance of WindowListenerTag. Sets the initial listener type.
    • Method Detail

      • registerListener

        protected boolean registerListener​(EventListener listener)
                                    throws org.apache.commons.jelly.JellyTagException,
                                           FormBuilderException
        Registers the event listener. This method is called during execution of this tag with the listener object created by the EventListenerTag.createEventListener() method. Its task is to perform tag-specific listener registration (this base class already takes about registration of the event listener at a bean that may be specified using the targetBean attribute). The return value indicates whether a registration was possible. If it is false and no targetBean attribute is defined, tag execution throws an exception because no target could be determined. This implementation checks whether this tag is nested inside a WindowBaseTag. If this is the case, the window created by this tag is obtained, and the listener is registered at this window.
        Specified by:
        registerListener in class EventListenerTag
        Parameters:
        listener - the listener to be registered
        Returns:
        a flag whether registration was successful
        Throws:
        org.apache.commons.jelly.JellyTagException - if an error occurs
        FormBuilderException - if the tag is incorrectly used
      • getActionBuilder

        protected ActionBuilder getActionBuilder()
        Returns a reference to the current ActionBuilder instance. This instance is expected to be placed in the Jelly context.
        Returns:
        the current action builder
      • getActionManager

        protected ActionManager getActionManager()
        Convenience method for obtaining a reference to the current ActionManager.
        Returns:
        the current action manager