Package javax.faces.el

Examples of javax.faces.el.MethodBinding


                comp.getAttributes().put("onfocus", _onfocus);
            }
        }
        if (_validator != null)
        {
            MethodBinding mb = context.getApplication().createMethodBinding(
                _validator, new Class[]{javax.faces.context.FacesContext.class,javax.faces.component.UIComponent.class,java.lang.Object.class,});
            comp.setValidator(mb);
        }
        if (_valueChangeListener != null)
        {
            MethodBinding mb = context.getApplication().createMethodBinding(
                _valueChangeListener, new Class[]{javax.faces.event.ValueChangeEvent.class,});
            comp.setValueChangeListener(mb);
        }
        if (_immediate != null)
        {
View Full Code Here


            if (! compId.equals(actionId)) {
                return;
            }
            actionParam = actionParam.substring(idx + 1);
            actionParam = decodeValueBinding(actionParam, context);
            MethodBinding mb;
            if (UIComponentTag.isValueReference(actionParam))
            {
                mb = context.getApplication().createMethodBinding(actionParam, null);
            }
            else
View Full Code Here

        return previousItem;
    }

    public static MethodBinding getMethodBinding(FacesContext facesContext, String value)
    {
        MethodBinding mb;
        if (HtmlNavigationMenuRendererUtils.isValueReference(value))
        {
            mb = facesContext.getApplication().createMethodBinding(value, null);
        }
        else
View Full Code Here

    public void broadcast(FacesEvent event)
        throws AbortProcessingException
    {
        super.broadcast(event);

        MethodBinding binding = getActionListener();

        if (binding != null) {
            FacesContext context = getFacesContext();
            binding.invoke(context, new Object[] { event });
        }
    }
View Full Code Here

                throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no InputSuggestAjax");
            }
            if (isValueReference(suggestedItemsMethod))
            {
              if (((InputSuggestAjax)component).getMaxSuggestedItems()!=null) {
                    MethodBinding mb = context.getApplication().createMethodBinding(suggestedItemsMethod,new Class[]{String.class, Integer.class});
                    ((InputSuggestAjax)component).setSuggestedItemsMethod(mb);
              } else {
                    MethodBinding mb = context.getApplication().createMethodBinding(suggestedItemsMethod,new Class[]{String.class});
                    ((InputSuggestAjax)component).setSuggestedItemsMethod(mb);
              }
             
             
            }
View Full Code Here

            if(component instanceof GraphicImageAjax)
            {               
              GraphicImageAjax graphicImageAjax = (GraphicImageAjax)component;
                try
                {
                  MethodBinding mbContentType = graphicImageAjax.getGetContentTypeMethod();
                  String contentType = (String)mbContentType.invoke(context,new Object[]{});
                 
                  MethodBinding mbBytes = graphicImageAjax.getGetBytesMethod();
                  byte[] bytes = (byte[])mbBytes.invoke(context,new Object[]{});
                 
                    //todo: fix this to work in PortletRequest as well
                    if(context.getExternalContext().getResponse() instanceof HttpServletResponse)
                    {
                      HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();
View Full Code Here

    {
        RendererUtils.checkParamValidity(context, uiComponent, InputSuggestAjax.class);

        InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) uiComponent;

        MethodBinding mb = inputSuggestAjax.getSuggestedItemsMethod();
        Collection suggesteds = null;
        int maxSuggestedCount = inputSuggestAjax.getMaxSuggestedItems()!=null
                      ? inputSuggestAjax.getMaxSuggestedItems().intValue()
                      : DEFAULT_MAX_SUGGESTED_ITEMS;
        if (inputSuggestAjax.getMaxSuggestedItems()!=null) {
          try{
            suggesteds = (Collection) mb.invoke(context,new Object[]{
                      AjaxPhaseListener.getValueForComponent(context, uiComponent),
                      new Integer(maxSuggestedCount)});
          }catch(MethodNotFoundException dummy){
            suggesteds = (List) mb.invoke(context,new Object[]{
                      AjaxPhaseListener.getValueForComponent(context, uiComponent)});
          }
        } else {
          try{
            suggesteds = (List) mb.invoke(context,new Object[]{
                      AjaxPhaseListener.getValueForComponent(context, uiComponent)});
          }catch(MethodNotFoundException dummy){
            suggesteds = (Collection) mb.invoke(context,new Object[]{
                        AjaxPhaseListener.getValueForComponent(context, uiComponent),
                        new Integer( DEFAULT_MAX_SUGGESTED_ITEMS )});
          }
        }
       
View Full Code Here

        if (actionListener != null)
        {
            if (isValueReference(actionListener))
            {
                MethodBinding actionListenerBinding = app.createMethodBinding(
                        actionListener, new Class[] { ActionEvent.class });
                schedule.setActionListener(actionListenerBinding);
            }
            else
            {
                throw new IllegalArgumentException(
                        "actionListener property must be a method-binding expression.");
            }
        }

        if (action != null)
        {
            if (isValueReference(action))
            {
                MethodBinding actionBinding = app.createMethodBinding(action,
                        new Class[] { ActionEvent.class });
                schedule.setAction(actionBinding);
            }
            else
            {
View Full Code Here

            {
                throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no GraphicImageAjax");
            }
            if (isValueReference(getContentTypeMethod))
            {
              MethodBinding mb = context.getApplication().createMethodBinding(getContentTypeMethod,new Class[]{});
                ((GraphicImageAjax)component).setGetContentTypeMethod(mb);
            }
            else
            {
                log.error("Invalid expression " + getContentTypeMethod);
View Full Code Here

            {
                throw new IllegalArgumentException("Component " + component.getClientId(context) + " is no GraphicImageAjax");
            }
            if (isValueReference(getBytesMethod))
            {
              MethodBinding mb = context.getApplication().createMethodBinding(getBytesMethod,new Class[]{});
                ((GraphicImageAjax)component).setGetBytesMethod(mb);
            }
            else
            {
                log.error("Invalid expression " + getBytesMethod);
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.