Examples of FaceletContext


Examples of javax.faces.view.facelets.FaceletContext

            compositeComponentBase.getAttributes().put(Resource.COMPONENT_RESOURCE_KEY, componentResource);
           
            // According to UserTagHandler, in this point we need to wrap the facelet
            // VariableMapper, so local changes are applied on "page context", but
            // data is retrieved from full context
            FaceletContext faceletContext = (FaceletContext) context.
                getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
            VariableMapper orig = faceletContext.getVariableMapper();
            try
            {
                faceletContext.setVariableMapper(new VariableMapperWrapper(orig));
               
                compositeComponentBase.pushComponentToEL(context, compositeComponentBase);
               
                compositeComponentFacelet.apply(context, compositeComponentBase);
               
                compositeComponentBase.popComponentFromEL(context);
            }
            finally
            {
                faceletContext.setVariableMapper(orig);
            }
           
            beanInfo = (BeanInfo) compositeComponentBase.getAttributes().get(UIComponent.BEANINFO_KEY);
        }
        catch(IOException e)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

    @SuppressWarnings("unchecked")
    public void applyAttachedObject(FacesContext context, UIComponent parent)
    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);
       
        // spec: if the disabled attribute is true, the validator should not be added.
        // in addition, the validatorId, if present, should be added to an exclusion
        // list on the parent component to prevent a default validator with the same
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

    }

    public void applyAttachedObject(FacesContext context, UIComponent parent)
    {
        // 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)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

     * ClientBehaviorHolder.getDefaultEventName()
     */
    public void applyAttachedObject(FacesContext context, UIComponent parent)
    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context
                .getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);

        // cast to a ClientBehaviorHolder
        ClientBehaviorHolder cvh = (ClientBehaviorHolder) parent;
       
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

        }
        DefaultFaceletContext ctx = new DefaultFaceletContext(facesContext, this, myFaceletContext);
       
        //Set FACELET_CONTEXT_KEY on FacesContext attribute map, to
        //reflect the current facelet context instance
        FaceletContext oldCtx = (FaceletContext)
                facesContext.getAttributes().put(FaceletContext.FACELET_CONTEXT_KEY, ctx);
       
        ctx.pushPageContext(new PageContextImpl());
       
        try
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

    }

    public void applyAttachedObject(FacesContext context, UIComponent parent)
    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);
       
        // cast to a ValueHolder
        ValueHolder vh = (ValueHolder) parent;
        ValueExpression ve = null;
        Converter c = null;
        if (_delegate.getBinding() != null)
        {
            ve = _delegate.getBinding().getValueExpression(faceletContext, Converter.class);
            c = (Converter) ve.getValue(faceletContext);
        }
        if (c == null)
        {
            c = this.createConverter(faceletContext);
            if (ve != null)
            {
                ve.setValue(faceletContext, c);
            }
        }
        if (c == null)
        {
            throw new TagException(_delegate.getTag(), "No Converter was created");
        }
        _delegate.setAttributes(faceletContext, c);
        vh.setConverter(c);
        Object lv = vh.getLocalValue();
        FacesContext faces = faceletContext.getFacesContext();
        if (lv instanceof String)
        {
            vh.setValue(c.getAsObject(faces, parent, (String) lv));
        }
    }
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

            compositeComponentBase.getAttributes().put(Resource.COMPONENT_RESOURCE_KEY, componentResource);

            // According to UserTagHandler, in this point we need to wrap the facelet
            // VariableMapper, so local changes are applied on "page context", but
            // data is retrieved from full context
            FaceletContext faceletContext = (FaceletContext) context.
                    getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
            VariableMapper orig = faceletContext.getVariableMapper();
            try
            {
                faceletContext.setVariableMapper(new VariableMapperWrapper(orig));

                compositeComponentBase.pushComponentToEL(context, compositeComponentBase);

                compositeComponentFacelet.apply(context, compositeComponentBase);

                compositeComponentBase.popComponentFromEL(context);
            }
            finally
            {
                faceletContext.setVariableMapper(orig);
            }

            beanInfo = (BeanInfo) compositeComponentBase.getAttributes().get(UIComponent.BEANINFO_KEY);
        }
        catch (IOException e)
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

     * ClientBehaviorHolder.getDefaultEventName()
     */
    public void applyAttachedObject(FacesContext context, UIComponent parent)
    {
        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context
                .getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);

        // cast to a ClientBehaviorHolder
        ClientBehaviorHolder cvh = (ClientBehaviorHolder) parent;
       
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

      }

      if (event.isLiteral()) {
        return event.getValue();
      } else {
        FaceletContext faceletContext = getFaceletContext(FacesContext.getCurrentInstance());
        ValueExpression expression = event.getValueExpression(faceletContext, String.class);
        return (String) expression.getValue(faceletContext);
      }
    }
View Full Code Here

Examples of javax.faces.view.facelets.FaceletContext

            }
        }   
    }

    protected FaceletContext getFaceletContext(FacesContext context) {
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
        if (faceletContext == null) {
            faceletContext = (FaceletContext) context.getAttributes().get("com.sun.faces.facelets.FACELET_CONTEXT");
        }
       
        return faceletContext;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.