Package javax.faces.component

Examples of javax.faces.component.ActionSource


  }

  public void apply(final FaceletContext faceletContext, final UIComponent parent) throws IOException {
    if (parent instanceof ActionSource) {
      if (ComponentHandler.isNew(parent)) {
        final ActionSource actionSource = (ActionSource) parent;
        if (forComponent.isLiteral())  {
          actionSource.addActionListener(new PopupActionListener(forComponent.getValue()));
        } else {
          final 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 apply(final FaceletContext faceletContext, final UIComponent parent) throws IOException {
    if (parent instanceof ActionSource) {
      if (ComponentHandler.isNew(parent)) {
        final ActionSource actionSource = (ActionSource) parent;
        if (execute == null) {
          actionSource.addActionListener(new ResetFormActionListener());
        } else if (execute.isLiteral())  {
          actionSource.addActionListener(new ResetInputActionListener(ComponentUtils.splitList(execute.getValue())));
        } else {
          final 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

    }
    if (!(component instanceof ActionSource)) {
      // TODO Message resource i18n
      throw new JspException("Component " + component.getClass().getName() + " is not instanceof ActionSource");
    }
    final 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

    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 apply(FaceletContext faceletContext, UIComponent parent) throws IOException, FacesException, FaceletException, ELException {
    if (ComponentSupport.isNew(parent)) {
      ValueExpression valueVE = value.getValueExpression(faceletContext, Object.class);
     
      ActionSource actionSource = (ActionSource) parent;
      actionSource.addActionListener(new FileDownloadActionListener(valueVE));
    }
  }
View Full Code Here

      if(removeFrom != null)
        removeFromVE = removeFrom.getValueExpression(faceletContext, Object.class);
       
      ValueExpression valueVE = value.getValueExpression(faceletContext, Object.class);
     
      ActionSource actionSource = (ActionSource) parent;
      actionSource.addActionListener(new Collector(addToVE, removeFromVE, valueVE));
    }
  }
View Full Code Here

      }
      if(postProcessor != null) {
        postProcessorME = postProcessor.getMethodExpression(faceletContext, null, new Class[]{Object.class});
      }
     
      ActionSource actionSource = (ActionSource) parent;
      actionSource.addActionListener(new DataExporter(targetVE, typeVE, fileNameVE, excludeColumnsVE, preProcessorME, postProcessorME));
    }
  }
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

  public void doDecode(FacesContext context, UIComponent component) {
    if(!DialogWindowRenderer.isSubmitted(getUtils(), context, component)) {
      return;
    }

    ActionSource actionSource = (ActionSource) component;
        MethodBinding binding = actionSource.getAction();
        if(!(binding instanceof DialogMethodBinding)) {
          actionSource.setAction(new DialogMethodBinding(binding, (ActionPrefixHolder)component));
        }
       
        DialogCloseEvent dialogEvent = new DialogCloseEvent(component);
       
        if(!UIDialogAction.isServerMode(component)) {
View Full Code Here

    DialogContext dcontext = DialogContextManager.getInstance(context).getContext(dialogId);

    String posReferenceId = (String)context.getExternalContext().getRequestParameterMap().get("posReferenceId");
    ((UIDialogWindow)component).setPosExternalReferenceId(posReferenceId);

    ActionSource actionSource = (ActionSource) component;

    /*
     * Specific navigation for open/close dialogs
     * includes prefixes to outcomes. We need to
     * intercept computed outcome to extract the prefix
     * and provide JSF with outcome stripped of it.
     */
        MethodBinding binding = actionSource.getAction();
        if(!(binding instanceof DialogMethodBinding)) {
          actionSource.setAction(new DialogMethodBinding(binding, (ActionPrefixHolder)component));
        }
       
        DialogOpenEvent dialogEvent = new DialogOpenEvent(component);
       
    if(!"close".equals(action) && !"closeall".equals(action)) {
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.