Package javax.faces.component

Examples of javax.faces.component.ActionSource


    public void applyAttachedObject(FacesContext context, UIComponent parent) {
        if (!(parent instanceof ActionSource)) {
            throw new TagException(this.tag, "Parent is not of type ActionSource, type is: " + parent);
        }

        ActionSource as = (ActionSource) parent;

        FaceletContext ctx = (FaceletContext) context.getAttributes().get(TagHandlerUtils.FACELET_CONTEXT_KEY);

        if (this.listenerMethod != null) {
            MethodExpression listenerMethodExpression = this.listenerMethod.getMethodExpression(ctx, Void.TYPE,
                new Class<?>[] { ActionEvent.class });

            as.addActionListener(new MethodExpressionActionListener(listenerMethodExpression));
        } else {
            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


      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, pageOnlyVE,excludeColumnsVE,encodingVE, preProcessorME, postProcessorME));
    }
  }
View Full Code Here

      ValueExpression contentDispositionVE = null;
     
      if(contentDisposition != null)
        contentDispositionVE= contentDisposition.getValueExpression(faceletContext, String.class);
     
      ActionSource actionSource = (ActionSource) parent;
      actionSource.addActionListener(new FileDownloadActionListener(valueVE, contentDispositionVE));
    }
  }
View Full Code Here

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

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

        ActionSource as = (ActionSource) parent;
        ValueExpression b = null;
        if (this.binding != null)
        {
            b = this.binding.getValueExpression(faceletContext, ActionListener.class);
        }
        ActionListener listener = new LazyActionListener(this.listenerType, b);
        as.addActionListener(listener);
    }
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;
    actionSource.addActionListener(new PopupActionListener(forComponent));
    return (SKIP_BODY);
  }
View Full Code Here

  public void apply(FaceletContext faceletContext,
      UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentSupport.isNew(parent))
    {
      ActionSource actionSource = (ActionSource)parent;
      ResetActionListener listener = new ResetActionListener();
      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.setValueBinding(SetActionListener.FROM_KEY,
                               new LegacyValueBinding(fromExpression));
      listener.setValueBinding(SetActionListener.TO_KEY,
                               new LegacyValueBinding(toExpression));
      actionSource.addActionListener(listener);
    }
  }
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.setValueBinding(ReturnActionListener.VALUE_KEY, new LegacyValueBinding(valueExp));
      actionSource.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.