Package org.apache.myfaces.shared.config

Examples of org.apache.myfaces.shared.config.MyfacesConfig


                                                                         component.getClientId(facesContext),
                                                                         set,
                                                                         target);
        }

        MyfacesConfig config = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());
        if (!config.isRenderFormViewStateAtBegin())
        {
            renderViewStateAndHiddenFields(facesContext, component);
        }

        afterFormElementsEnd(facesContext, component);
View Full Code Here


    public static void init(ExternalContext context)
    {
        WebXmlParser parser = new WebXmlParser(context);
        WebXml webXml = parser.parse();
        context.getApplicationMap().put(WEB_XML_ATTR, webXml);
        MyfacesConfig mfconfig = MyfacesConfig.getCurrentInstance(context);
        long configRefreshPeriod = mfconfig.getConfigRefreshPeriod();
        webXml.setParsingTime(System.currentTimeMillis());
        webXml.setDelegateFacesServlet(mfconfig.getDelegateFacesServlet());
        refreshPeriod = (configRefreshPeriod * 1000);
    }
View Full Code Here

        _componentsMarkedForDeletion = new ArrayList<Map<String,UIComponent>>();
        _relocatableResourceForDeletion = new HashMap<String, UIComponent>();
        _deletionLevel = -1;
        _sectionUniqueIdCounter = new SectionUniqueIdCounter();
        //Cached at facelet view
        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(
                facesContext.getExternalContext());
        if (myfacesConfig.getComponentUniqueIdsCacheSize() > 0)
        {
            String[] componentIdsCache = (String [])facesContext.getExternalContext().
                    getApplicationMap().get(FaceletViewDeclarationLanguage.CACHED_COMPONENT_IDS);
            if (componentIdsCache != null)
            {
View Full Code Here

        {
            // escape every ' in the user event code since it will
            // be a string attribute of jsf.util.chain
            finalParams.add('\'' + escapeJavaScriptForChain(userEventCode) + '\'');
        }
        final MyfacesConfig currentInstance = MyfacesConfig
                .getCurrentInstance(externalContext);
        ScriptContext behaviorCode = new ScriptContext();
        ScriptContext retVal = new ScriptContext(currentInstance.isPrettyHtml());
        getClientBehaviorScript(facesContext, uiComponent, targetClientId,
                eventName, clientBehaviors, behaviorCode, params);
        if (behaviorCode != null
                && !behaviorCode.toString().trim().equals(STR_EMPTY))
        {
View Full Code Here

        if (userEventCode != null && !userEventCode.trim().equals(STR_EMPTY))
        {
            finalParams.add('\'' + escapeJavaScriptForChain(userEventCode) + '\'');
        }

        final MyfacesConfig currentInstance = MyfacesConfig
                .getCurrentInstance(externalContext);
        ScriptContext behaviorCode = new ScriptContext();
        ScriptContext retVal = new ScriptContext(currentInstance.isPrettyHtml());
        boolean submitting1 = getClientBehaviorScript(facesContext,
                uiComponent, targetClientId, eventName1, clientBehaviors,
                behaviorCode, params);
        ScriptContext behaviorCode2 = new ScriptContext();
        boolean submitting2 = getClientBehaviorScript(facesContext,
View Full Code Here

        _initializeBuffer(eContext);
        _initializeMode(eContext);
       
        // Create a component ids cache and store it on application map to
        // reduce the overhead associated with create such ids over and over.
        MyfacesConfig mfConfig = MyfacesConfig.getCurrentInstance(eContext);
        if (mfConfig.getComponentUniqueIdsCacheSize() > 0)
        {
            String[] componentIdsCached = SectionUniqueIdCounter.generateUniqueIdCache("_",
                    mfConfig.getComponentUniqueIdsCacheSize());
            eContext.getApplicationMap().put(
                    CACHED_COMPONENT_IDS, componentIdsCached);
        }

        log.finest("Initialization Successful");
View Full Code Here

        }
    }

    public static boolean isJavascriptAllowed(ExternalContext externalContext)
    {
        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(externalContext);
        if (myfacesConfig.isAllowJavascript())
        {
            if (myfacesConfig.isDetectJavascript())
            {
                return isJavascriptDetected(externalContext);
            }
            else
            {
View Full Code Here

        }
    }
   
    public static boolean isRenderClearJavascriptOnButton(ExternalContext externalContext)
    {
        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(externalContext);
        if (myfacesConfig.isRenderClearJavascriptOnButton())
        {
            return true;
        }
        else
        {
View Full Code Here

        }
    }
   
    public static boolean isSaveFormSubmitLinkIE(ExternalContext externalContext)
    {
        MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(externalContext);
        if (myfacesConfig.isSaveFormSubmitLinkIE())
        {
            return true;
        }
        else
        {
View Full Code Here

       
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT", "false");
        MockExternalContext mockExtCtx = new MockExternalContext(servletContext,
                new MockHttpServletRequest(), new MockHttpServletResponse());
        MyfacesConfig config = MyfacesConfig.getCurrentInstance(mockExtCtx);
        facesContext.setExternalContext(mockExtCtx);
       
        HtmlCheckAttributesUtil.checkRenderedAttributes(
                commandLink, facesContext, writer, attrs);
        if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs)) {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.shared.config.MyfacesConfig

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.