Package javax.faces.el

Examples of javax.faces.el.MethodBinding


    super.setProperties(bean);
    setBooleanProperty(bean, UIXShowDetail.DISCLOSED_KEY, _disclosed);
    setBooleanProperty(bean, UIXShowDetail.IMMEDIATE_KEY, _immediate);
    if (_disclosureListener != null)
    {
      MethodBinding mb = createMethodBinding(_disclosureListener, new Class[]{org.apache.myfaces.trinidad.event.DisclosureEvent.class,});
      bean.setProperty(UIXShowDetail.DISCLOSURE_LISTENER_KEY, mb);
    }
  }
View Full Code Here


    // Notify the specified action listener method (if any),
    // and the default action listener
    if (event instanceof ActionEvent)
    {
      FacesContext context = getFacesContext();
      MethodBinding mb = getActionListener();
      if (mb != null)
        mb.invoke(context, new Object[] { event });

      ActionListener defaultActionListener =
        context.getApplication().getActionListener();
      if (defaultActionListener != null)
      {
View Full Code Here

    FacesBean bean)
  {
    super.setProperties(bean);
    if (_rowDisclosureListener != null)
    {
      MethodBinding mb = createMethodBinding(_rowDisclosureListener, new Class[]{org.apache.myfaces.trinidad.event.RowDisclosureEvent.class,});
      bean.setProperty(UIXNavigationTree.ROW_DISCLOSURE_LISTENER_KEY, mb);
    }
    setProperty(bean, UIXNavigationTree.DISCLOSED_ROW_KEYS_KEY, _disclosedRowKeys);
    setProperty(bean, UIXNavigationTree.VALUE_KEY, _value);
    setIntegerProperty(bean, UIXNavigationTree.START_LEVEL_KEY, _startLevel);
View Full Code Here

  {
    super.setProperties(bean);
    setIntArrayProperty(bean, UIXTreeTable.ROWS_BY_DEPTH_KEY, _rowsByDepth);
    if (_rangeChangeListener != null)
    {
      MethodBinding mb = createMethodBinding(_rangeChangeListener, new Class[]{org.apache.myfaces.trinidad.event.RangeChangeEvent.class,});
      bean.setProperty(UIXTreeTable.RANGE_CHANGE_LISTENER_KEY, mb);
    }
  }
View Full Code Here

    FacesBean bean)
  {
    super.setProperties(bean);
    if (_action != null)
    {
      MethodBinding mb;
      if (isValueReference(_action))
        mb = createMethodBinding(_action, new Class[0]);
      else
        mb = new org.apache.myfaces.trinidadinternal.taglib.ConstantMethodBinding(_action);
      bean.setProperty(UIXCommand.ACTION_KEY, mb);
    }
    if (_actionListener != null)
    {
      MethodBinding mb = createMethodBinding(_actionListener, new Class[]{javax.faces.event.ActionEvent.class,});
      bean.setProperty(UIXCommand.ACTION_LISTENER_KEY, mb);
    }
    if (_returnListener != null)
    {
      MethodBinding mb = createMethodBinding(_returnListener, new Class[]{org.apache.myfaces.trinidad.event.ReturnEvent.class,});
      bean.setProperty(UIXCommand.RETURN_LISTENER_KEY, mb);
    }
    if (_launchListener != null)
    {
      MethodBinding mb = createMethodBinding(_launchListener, new Class[]{org.apache.myfaces.trinidad.event.LaunchEvent.class,});
      bean.setProperty(UIXCommand.LAUNCH_LISTENER_KEY, mb);
    }
    setBooleanProperty(bean, UIXCommand.IMMEDIATE_KEY, _immediate);
  }
View Full Code Here

  {
    super.setProperties(bean);
    setBooleanProperty(bean, UIXPoll.IMMEDIATE_KEY, _immediate);
    if (_pollListener != null)
    {
      MethodBinding mb = createMethodBinding(_pollListener, new Class[]{org.apache.myfaces.trinidad.event.PollEvent.class,});
      bean.setProperty(UIXPoll.POLL_LISTENER_KEY, mb);
    }
  }
View Full Code Here

    FacesBean bean)
  {
    super.setProperties(bean);
    if (_rowDisclosureListener != null)
    {
      MethodBinding mb = createMethodBinding(_rowDisclosureListener, new Class[]{org.apache.myfaces.trinidad.event.RowDisclosureEvent.class,});
      bean.setProperty(UIXPage.ROW_DISCLOSURE_LISTENER_KEY, mb);
    }
    setProperty(bean, UIXPage.DISCLOSED_ROW_KEYS_KEY, _disclosedRowKeys);
    setProperty(bean, UIXPage.VALUE_KEY, _value);
    setProperty(bean, UIXPage.VAR_STATUS_KEY, _varStatus);
View Full Code Here

    FacesBean bean)
  {
    super.setProperties(bean);
    if (_rowDisclosureListener != null)
    {
      MethodBinding mb = createMethodBinding(_rowDisclosureListener, new Class[]{org.apache.myfaces.trinidad.event.RowDisclosureEvent.class,});
      bean.setProperty(UIXTable.ROW_DISCLOSURE_LISTENER_KEY, mb);
    }
    setProperty(bean, UIXTable.DISCLOSED_ROW_KEYS_KEY, _disclosedRowKeys);
    if (_selectionListener != null)
    {
      MethodBinding mb = createMethodBinding(_selectionListener, new Class[]{org.apache.myfaces.trinidad.event.SelectionEvent.class,});
      bean.setProperty(UIXTable.SELECTION_LISTENER_KEY, mb);
    }
    setProperty(bean, UIXTable.SELECTED_ROW_KEYS_KEY, _selectedRowKeys);
    setBooleanProperty(bean, UIXTable.IMMEDIATE_KEY, _immediate);
    if (_sortListener != null)
    {
      MethodBinding mb = createMethodBinding(_sortListener, new Class[]{org.apache.myfaces.trinidad.event.SortEvent.class,});
      bean.setProperty(UIXTable.SORT_LISTENER_KEY, mb);
    }
    if (_rangeChangeListener != null)
    {
      MethodBinding mb = createMethodBinding(_rangeChangeListener, new Class[]{org.apache.myfaces.trinidad.event.RangeChangeEvent.class,});
      bean.setProperty(UIXTable.RANGE_CHANGE_LISTENER_KEY, mb);
    }
  }
View Full Code Here

    UIXComponent uixComponent = (UIXComponent) component;

    if (_attributeChangeListener != null)
    {
      MethodBinding mb =
        createMethodBinding(_attributeChangeListener,
                            new Class[]{AttributeChangeEvent.class});
      uixComponent.setAttributeChangeListener(mb);
    }
View Full Code Here

        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application application = facesContext.getApplication();
        UIComponent component = actionEvent.getComponent();
       
        MethodExpression methodExpression = null;
        MethodBinding methodBinding = null;
       
        String fromAction = null;
        String outcome = null;
       
        if (component instanceof ActionSource2)
        {
            // Must be an instance of ActionSource2, so don't look on action if the actionExpression is set
            methodExpression = ((ActionSource2) component).getActionExpression();           
        }
        if (methodExpression == null && component instanceof ActionSource)
        {
            // Backwards compatibility for pre-1.2.
            methodBinding = ((ActionSource) component).getAction();
        }
       
        if (methodExpression != null)
        {
            fromAction = methodExpression.getExpressionString();
            try
            {
                Object objOutcome = methodExpression.invoke(facesContext.getELContext(), null);
                if (objOutcome != null)
                {
                    outcome = objOutcome.toString();
                }
            }
            catch (ELException e)
            {
                // "... If that fails for any reason, throw an AbortProcessingException,
                // including the cause of the failure ..."
                // -= Leonardo Uribe =- after discussing this topic on MYFACES-3199,
                // the conclusion is the part is an advice
                // for the developer implementing a listener in a method expressions
                // that could be wrapped by this class.
                // The spec wording is poor but, to keep this coherently with
                // ExceptionHandler API, the spec and code on UIViewRoot we need:
                // 2a) "exception is instance of APE or any of the causes of
                // the exception are an APE,
                // DON'T publish ExceptionQueuedEvent and terminate processing for current event".
                // 2b) for any other exception publish ExceptionQueuedEvent and continue broadcast processing.
                Throwable cause = e.getCause();
                AbortProcessingException ape = null;
                if (cause != null)
                {
                    do
                    {
                        if (cause != null && cause instanceof AbortProcessingException)
                        {
                            ape = (AbortProcessingException) cause;
                            break;
                        }
                        cause = cause.getCause();
                    }
                    while (cause != null);
                }
               
                if (ape != null)
                {
                    // 2a) "exception is instance of APE or any of the causes of the exception are an APE,
                    // DON'T publish ExceptionQueuedEvent and terminate processing for current event".
                    // To do this throw an AbortProcessingException here, later on UIViewRoot.broadcastAll,
                    // this exception will be received and stored to handle later.
                    throw ape;
                }
               
                // Since this ActionListener is the one who handles navigation, if we have another different exception
                // here we can't queue it on ExceptionHandler stack, instead throw it as a FacesException.
                throw new FacesException("Error calling action method of component with id "
                                         + actionEvent.getComponent().getClientId(facesContext), e);
            }
            catch (RuntimeException e)
            {
                throw new FacesException("Error calling action method of component with id "
                                         + actionEvent.getComponent().getClientId(facesContext), e);
            }
        }
       
        else if (methodBinding != null)
        {
            fromAction = methodBinding.getExpressionString();
            try
            {
                Object objOutcome = methodBinding.invoke(facesContext, null);

                if (objOutcome != null)
                {
                    outcome = objOutcome.toString();
                }
View Full Code Here

TOP

Related Classes of javax.faces.el.MethodBinding

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.