Package javax.faces.component

Examples of javax.faces.component.ActionSource


    public void processAction(ActionEvent actionEvent) throws AbortProcessingException
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application application = facesContext.getApplication();

        ActionSource actionSource = (ActionSource)actionEvent.getComponent();
        MethodBinding methodBinding = actionSource.getAction();

        String fromAction;
        String outcome;
        if (methodBinding == null)
        {
View Full Code Here


    public void processAction(ActionEvent actionEvent) throws AbortProcessingException
    {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        Application application = facesContext.getApplication();

        ActionSource actionSource = (ActionSource)actionEvent.getComponent();
        MethodBinding methodBinding = actionSource.getAction();

        String fromAction = null;
        String outcome = null;
        if (methodBinding != null)
        {
View Full Code Here

                }
                parentComponent = parentComponent.getParent();
            }
        }

        ActionSource as = (ActionSource) parent;
        ActionListener listener = null;
        if (_render.isLiteral())
        {
            listener = new LiteralResetValuesActionListener(_clientIds,
                topParentComponent != null ?
                (Location) topParentComponent.getAttributes().get(
                    CompositeComponentELUtils.LOCATION_KEY) : null);
        }
        else
        {
            listener = new ResetValuesActionListener(_render
                .getValueExpression(faceletContext, Object.class) ,
                topParentComponent != null ?
                (Location) topParentComponent.getAttributes().get(
                    CompositeComponentELUtils.LOCATION_KEY) : null);
        }
        as.addActionListener(listener);
    }
View Full Code Here

        throws AbortProcessingException {

        // If this is an immediate action, or we are NOT nested in a
        // Struts form, perform the standard processing
        UIComponent component = event.getComponent();
        ActionSource source = (ActionSource) component;
        boolean standard = source.isImmediate();
        if (!standard) {
            UIComponent parent = component.getParent();
            while (parent != null) {
                if (parent instanceof UIForm) {
                    if (!(parent instanceof FormComponent)) {
View Full Code Here

          UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentSupport.isNew(parent))
    {
      ValueExpression valueExp = _value.getValueExpression(faceletContext, Object.class);
      ActionSource actionSource = (ActionSource)parent;
      ReturnActionListener listener = new ReturnActionListener();
      listener.setValueExpression(ReturnActionListener.VALUE_KEY, valueExp);
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here

      // =-=AEW Couldn't this be cached?
      ValueExpression fromExpression = _from.getValueExpression(faceletContext,
                                                                Object.class);
      ValueExpression toExpression=  _to.getValueExpression(faceletContext,
                                                            Object.class);
      ActionSource actionSource= (ActionSource) parent;
      SetActionListener listener = new SetActionListener();
      listener.setValueExpression(SetActionListener.FROM_KEY,
                                  fromExpression);
      listener.setValueExpression(SetActionListener.TO_KEY,
                                  toExpression);
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here

     */
    public void apply(FaceletContext ctx, UIComponent parent)
            throws IOException, FacesException, FaceletException, ELException {
        if (parent instanceof ActionSource) {
          if (ComponentSupport.isNew(parent)) {
        ActionSource as = (ActionSource) parent;
        ValueExpression b = null;
        if (this.binding != null) {
          b = this.binding.getValueExpression(ctx, ActionListener.class);
        }
        ActionListener listener = new LazyActionListener(this.listenerType, b);
        as.addActionListener(listener);
      }
        } else {
            throw new TagException(this.tag,
                    "Parent is not of type ActionSource, type is: " + parent);
        }
View Full Code Here

      FacesContext facesContext = FacesContext.getCurrentInstance();
      FacesMessage facesMessage
          = new FacesMessage(e.getCause().toString());
      facesContext.addMessage(null, facesMessage);
      UIComponent source = event.getComponent();
      ActionSource actionSource = (ActionSource) source;
      Application application = facesContext.getApplication();
      MethodBinding binding = actionSource.getAction();
      // Retrieve the NavigationHandler instance..
      NavigationHandler navHandler = application.getNavigationHandler();
      // Invoke nav handling..
      String navBinding =
          (null != binding) ? binding.getExpressionString() : null;
View Full Code Here

        if (LOGGER.isLoggable(Level.FINE)) {
            LOGGER.fine(MessageFormat.format("processAction({0})",
                                             event.getComponent().getId()));
        }
        UIComponent source = event.getComponent();
        ActionSource actionSource = (ActionSource) source;
        FacesContext context = FacesContext.getCurrentInstance();

        Application application = context.getApplication();

        Object invokeResult;
        String outcome = null;
        MethodBinding binding;

        binding = actionSource.getAction();
        if (binding != null) {
            try {
                if (null != (invokeResult = binding.invoke(context, null))) {
                    outcome = invokeResult.toString();
                }
View Full Code Here

      throw new JspException("Component " + component.getClass().getName() + " is not instanceof ActionSource");
    }

    final ELContext elContext = FacesContext.getCurrentInstance().getELContext();

    final ActionSource actionSource = (ActionSource) component;
    if (execute == null) {
      actionSource.addActionListener(new ResetFormActionListener());
    } else if (execute.isLiteralText()) {
      actionSource.addActionListener(new ResetInputActionListener(
          ComponentUtils.splitList((String) execute.getValue(elContext))));
    } else {
      actionSource.addActionListener(new ValueExpressionResetInputActionListener(execute));
    }
    return (SKIP_BODY);
  }
View Full Code Here

TOP

Related Classes of javax.faces.component.ActionSource

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.