Package javax.faces.event

Examples of javax.faces.event.ActionListener


        // Notify the specified action listener method (if any),
        // and the default action listener
        broadcastToMethodBinding(event, getActionListener());

        FacesContext context = getFacesContext();
        ActionListener defaultActionListener =
          context.getApplication().getActionListener();
        if (defaultActionListener != null)
        {
          defaultActionListener.processAction((ActionEvent) event);
        }
      }
      finally
      {
        afContext.getDialogService().setCurrentLaunchSource(null);
View Full Code Here


        // Notify the specified action listener method (if any),
        // and the default action listener
        broadcastToMethodBinding(event, getActionListener());

        FacesContext context = getFacesContext();
        ActionListener defaultActionListener =
          context.getApplication().getActionListener();
        if (defaultActionListener != null)
        {
          defaultActionListener.processAction((ActionEvent) event);
        }
      }
      finally
      {
        afContext.getDialogService().setCurrentLaunchSource(null);
View Full Code Here

       
       
        ActionListenerImplementation actionListener = new ActionListenerImplementation(differentUiCommand);
        uiCommand.addActionListener(actionListener);
       
        ActionListener differentActionListener = org.easymock.EasyMock.createNiceMock(ActionListener.class);
        differentActionListener.processAction(actionListener.newActionEventFromListener);
        org.easymock.EasyMock.expectLastCall().times(1);
        org.easymock.EasyMock.replay(differentActionListener);
        differentUiCommand.addActionListener(differentActionListener);
       
        // Simulates first event, in most cases click in GUI
View Full Code Here

                                    }
                                }
                                else if ("actionListener".equals(attributeName))
                                {
                                    //First try to remove any prevous target if any
                                    ActionListener o = (ActionListener) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
                                    if (o != null)
                                    {
                                        ((ActionSource2) innerComponent).removeActionListener(o);
                                    }

                                    // target is ActionSource2
                                    ActionListener actionListener = null;
                                    // If it is a redirection, a wrapper is used to locate the right instance and call it properly.
                                    if (ccAttrMeRedirection)
                                    {
                                        actionListener = new RedirectMethodExpressionValueExpressionActionListener(attributeNameValueExpression);
                                    }
View Full Code Here

    }

    private ActionListener _createActionListener()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ActionListener listener = null;
        // type and/or binding must be specified
        try
        {
            if (null != _binding)
            {
View Full Code Here

            return;
        }
       
        if (event instanceof ActionEvent)
        {
            ActionListener defaultActionListener = context.getApplication().getActionListener();
            if (defaultActionListener != null)
            {
                String  viewIdBeforeAction = context.getViewRoot().getViewId();
                Boolean oldBroadcastProcessing = (Boolean) context.getAttributes().
                    get(BROADCAST_PROCESSING_KEY);
                try
                {
                    context.getAttributes().put(BROADCAST_PROCESSING_KEY, Boolean.TRUE);

                    ViewActionFacesContextWrapper wrappedFacesContext = new ViewActionFacesContextWrapper(context);

                    try
                    {
                        wrappedFacesContext.setWrapperAsCurrentFacesContext();

                        MethodBinding mb = getActionListener();
                        if (mb != null)
                        {
                            mb.invoke(context, new Object[]
                            { event });
                        }

                        if (defaultActionListener != null)
                        {
                            defaultActionListener.processAction((ActionEvent) event);
                        }
                       
                        // Decrement count
                        Integer count = (Integer) context.getAttributes().get(EVENT_COUNT_KEY);
                        count = (count == null) ? 0 : count - 1;
View Full Code Here

    {
        Application application = ((ApplicationFactory)
                FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY)).getApplication();

        FacesConfigData dispenser = getDispenser();
        ActionListener actionListener = ClassUtils.buildApplicationObject(ActionListener.class,
                dispenser.getActionListenerIterator(), null);
        _callInjectAndPostConstruct(actionListener);
        application.setActionListener(actionListener);

        if (dispenser.getDefaultLocale() != null)
View Full Code Here

            String attributeExpressionString,
            ValueExpression attributeNameValueExpression,
            boolean ccAttrMeRedirection)
    {
        //First try to remove any prevous target if any
        ActionListener o = (ActionListener)
                mctx.removeMethodExpressionTargeted(innerComponent, targetAttributeName);
        if (o != null)
        {
            ((ActionSource2) innerComponent).removeActionListener(o);
        }

        // target is ActionSource2
        ActionListener actionListener = null;
        // If it is a redirection, a wrapper is used to locate the right instance and call
        //it properly.
        if (ccAttrMeRedirection)
        {
            actionListener = new RedirectMethodExpressionValueExpressionActionListener(
View Full Code Here

    }

    private ActionListener _createActionListener()
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ActionListener listener = null;
        // type and/or binding must be specified
        try
        {
            if (null != _binding)
            {
View Full Code Here

       
       
        ActionListenerImplementation actionListener = new ActionListenerImplementation(differentUiCommand);
        uiCommand.addActionListener(actionListener);
       
        ActionListener differentActionListener = org.easymock.EasyMock.createNiceMock(ActionListener.class);
        differentActionListener.processAction(actionListener.newActionEventFromListener);
        org.easymock.EasyMock.expectLastCall().times(1);
        org.easymock.EasyMock.replay(differentActionListener);
        differentUiCommand.addActionListener(differentActionListener);
       
        // Simulates first event, in most cases click in GUI
View Full Code Here

TOP

Related Classes of javax.faces.event.ActionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.