Package javax.faces.component

Examples of javax.faces.component.ActionSource


    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);

        ActionSource src = (ActionSource) parent;
        ValueExpression valueExpr = _value.getValueExpression(faceletContext, Object.class);
        ValueExpression targetExpr = _target.getValueExpression(faceletContext, Object.class);

        src.addActionListener(new SetPropertyListener(valueExpr, targetExpr));
    }
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;
        String outcome;
        if (methodBinding == null)
        {
View Full Code Here

    }
    if (!(component instanceof ActionSource)) {
      // TODO Message resource i18n
      throw new JspException("Component " + component.getClass().getName() + " is not instanceof ActionSource");
    }
    ActionSource actionSource = (ActionSource) component;
    if (!isExecuteSet()) {
      actionSource.addActionListener(new ResetFormActionListener());
    } else if (isExecuteLiteral()) {
      actionSource.addActionListener(new ResetInputActionListener(ComponentUtils.splitList(getExecuteValue())));
    } else {
      FacesUtils.addBindingOrExpressionResetActionListener(actionSource, getExecuteAsBindingOrExpression());
    }
    return (SKIP_BODY);
  }
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

    }
    if (!(component instanceof ActionSource)) {
      // TODO Message resource i18n
      throw new JspException("Component " + component.getClass().getName() + " is not instanceof ActionSource");
    }
    ActionSource actionSource = (ActionSource) component;

    component.setValueExpression(Attributes.FOR, forValue);

    if (forValue.isLiteralText()) {
      actionSource.addActionListener(new PopupActionListener(
          (String) forValue.getValue(FacesContext.getCurrentInstance().getELContext())));
    } else {
      component.setValueExpression(Attributes.FOR, forValue);
    }
    return (SKIP_BODY);
View Full Code Here

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

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

    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

  public void apply(FaceletContext faceletContext, UIComponent parent)
      throws IOException, FacesException, ELException {
    if (parent instanceof ActionSource) {
      if (ComponentHandler.isNew(parent)) {
        ActionSource actionSource = (ActionSource) parent;
        if (execute == null) {
          actionSource.addActionListener(new ResetFormActionListener());
        } else if (execute.isLiteral())  {
          actionSource.addActionListener(new ResetInputActionListener(ComponentUtils.splitList(execute.getValue())));
        } else {
          ValueExpression forValueExpression = execute.getValueExpression(faceletContext, String.class);
          actionSource.addActionListener(new ValueExpressionResetInputActionListener(forValueExpression));
        }
      }
    } else {
      throw new TagException(tag, "Parent is not of type ActionSource, type is: " + parent);
    }
View Full Code Here

  public void apply(FaceletContext faceletContext, UIComponent parent)
      throws IOException, FacesException, ELException {
    if (parent instanceof ActionSource) {
      if (ComponentHandler.isNew(parent)) {
        ActionSource actionSource = (ActionSource) parent;
        if (forComponent.isLiteral())  {
          actionSource.addActionListener(new PopupActionListener(forComponent.getValue()));
        } else {
          ValueExpression forValueExpression = forComponent.getValueExpression(faceletContext, String.class);
          actionSource.addActionListener(new ValueExpressionPopupActionListener(forValueExpression));
        }
      }
    } else {
      throw new TagException(tag, "Parent is not of type ActionSource, type is: " + parent);
    }
View Full Code Here

    public void applyAttachedObject(FacesContext context, UIComponent parent) {
        FaceletContext ctx = (FaceletContext) context.getAttributes()
              .get(FaceletContext.FACELET_CONTEXT_KEY);

        ActionSource src = (ActionSource) parent;
        ValueExpression valueExpr = this.value.getValueExpression(ctx,
                    Object.class);
        ValueExpression targetExpr = this.target.getValueExpression(
                ctx, Object.class);

        ActionListener listener;

        if (src instanceof ActionSource2) {
            listener = new SetPropertyListener(valueExpr, targetExpr);
        } else {
            listener = new LegacySetPropertyListener(
                    new LegacyValueBinding(valueExpr),
                    new LegacyValueBinding(targetExpr));
        }

        src.addActionListener(listener);
    }
View Full Code Here

    }

    public void applyAttachedObject(FacesContext context, UIComponent parent) {
        FaceletContext ctx = (FaceletContext) context.getAttributes()
              .get(FaceletContext.FACELET_CONTEXT_KEY);
        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);
    }
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.