Package javax.faces.event

Examples of javax.faces.event.ActionListener


                                    ((ActionSource2)innerComponent).setActionExpression(methodExpression);
                                }
                                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
                                    methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                                            createMethodExpression(elContext,
                                                    attributeExpressionString, Void.TYPE, ACTION_LISTENER_SIGNATURE), attributeNameValueExpression);
                                   
                                    methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
                                        createMethodExpression(elContext,
                                                attributeExpressionString, Void.TYPE, EMPTY_CLASS_ARRAY), attributeNameValueExpression);
                                   
                                    ActionListener actionListener = new MethodExpressionActionListener(methodExpression, methodExpression2);
                                    ((ActionSource2)innerComponent).addActionListener(actionListener);
                                    mctx.addMethodExpressionTargeted(innerComponent, attributeName, actionListener);
                                }
                                else if ("validator".equals(attributeName))
                                {
View Full Code Here


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

      ActionListener defaultActionListener =
        context.getApplication().getActionListener();
      if (defaultActionListener != null)
      {
        defaultActionListener.processAction((ActionEvent) event);
      }
    }
  }
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

        // 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

    }

    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

        // 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

                }
                else
                {
                    className = _type;
                }
                ActionListener al = (ActionListener)ClassUtils.newInstance(className);
                ((ActionSource)component).addActionListener(al);
            }
            else
            {
                throw new JspException("Component " + component.getId() + " is no ActionSource");
View Full Code Here

    if (facesEvent instanceof TabChangeEvent && facesEvent.getComponent() == this) {
      FacesUtils.invokeMethodBinding(getFacesContext(), getTabChangeListener(), facesEvent);

      FacesUtils.invokeMethodBinding(getFacesContext(), getActionListener(), facesEvent);
      if (!isSwitchTypeClient()) {
        ActionListener defaultActionListener = getFacesContext().getApplication().getActionListener();
        if (defaultActionListener != null) {
          defaultActionListener.processAction((ActionEvent) facesEvent);
        }
      }
      Integer index = ((TabChangeEvent) facesEvent).getNewTabIndex();
      if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.SELECTED_INDEX)) {
        FacesUtils.setValueOfBindingOrExpression(getFacesContext(), index, this, Attributes.SELECTED_INDEX);
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.