Package javax.faces.component

Examples of javax.faces.component.UIViewRoot$Events


        if (isSavingStateInClient(facesContext))
        {
            if (log.isLoggable(Level.FINEST)) log.finest("Processing writeStateAsUrlParams - client-side state saving writing state");

            UIViewRoot uiViewRoot = facesContext.getViewRoot();
            //save state in response (client)
            RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, uiViewRoot.getRenderKitId());
            ResponseStateManager responseStateManager = renderKit.getResponseStateManager();
            if (responseStateManager instanceof MyfacesResponseStateManager)
            {
                ((MyfacesResponseStateManager)responseStateManager).writeStateAsUrlParams(facesContext,
                                                                                          serializedView);
            }
            else
            {
                log.severe("ResponseStateManager of render kit " + uiViewRoot.getRenderKitId() + " is no MyfacesResponseStateManager and does not support saving state in url parameters.");
            }
        }

        if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeStateAsUrlParams");
    }
View Full Code Here


            return null;
        }

        Locale locale = Locale.getDefault();

        final UIViewRoot viewRoot = facesContext.getViewRoot();
        if (viewRoot != null && viewRoot.getLocale() != null)
        {
            locale = viewRoot.getLocale();
        }

        try
        {
            return getResourceBundle(bundleName, locale, getClassLoader());
View Full Code Here

                // argument. If the list is not empty, perform algorithm traverseListenerList on the list.
                event = _traverseListenerList(holder.getListenersForEventClass(systemEventClass), systemEventClass,
                                              source, event);
            }
           
            UIViewRoot uiViewRoot = facesContext.getViewRoot();
            if (uiViewRoot != null)
            {
                //Call listeners on view level
                event = _traverseListenerList(uiViewRoot.getViewListenersForEventClass(systemEventClass),
                        systemEventClass, source, event);
            }

            SystemListenerEntry systemListenerEntry = _systemEventListenerClassMap.get(systemEventClass);
            if (systemListenerEntry != null)
View Full Code Here

        /*
         * Obtain a reference to the ViewDeclarationLanguage for this Application instance by calling
         * ViewHandler.getViewDeclarationLanguage(javax.faces.context.FacesContext, java.lang.String), passing the
         * viewId found by calling UIViewRoot.getViewId() on the UIViewRoot in the argument FacesContext.
         */
        UIViewRoot view = context.getViewRoot();
        ViewDeclarationLanguage vdl = getViewHandler().getViewDeclarationLanguage(context, view.getViewId());

        /*
         * Obtain a reference to the composite component metadata for this composite component by calling
         * ViewDeclarationLanguage.getComponentMetadata(javax.faces.context.FacesContext,
         * javax.faces.application.Resource), passing the facesContext and componentResource arguments to this method.
View Full Code Here

            if (t == null)
            {
                throw new IllegalStateException("No Exception to handle");
            }
           
            UIViewRoot view = (UIViewRoot) requestMap.get(VIEW_KEY);
           
            StringWriter writer = new StringWriter();
            ErrorPageWriter.debugHtml(writer, facesContext, t, view);
            String html = writer.toString();
           
View Full Code Here

    }

    protected void handleRenderException(FacesContext context, Exception e)
            throws IOException, ELException, FacesException
    {
        UIViewRoot root = context.getViewRoot();
        StringBuffer sb = new StringBuffer(64);
        sb.append("Error Rendering View");
        if (root != null)
        {
            sb.append('[');
            sb.append(root.getViewId());
            sb.append(']');
        }
       
        log.log(Level.SEVERE, sb.toString(), e);
       
View Full Code Here

   
    public boolean execute(FacesContext facesContext)
    {
        Application application = facesContext.getApplication();
        ViewHandler viewHandler = application.getViewHandler();
        UIViewRoot root;
        String viewId;
        String newViewId;
       
        // JSF 2.0 section 2.2.6: if the current response
        // is a partial response, then there must be
        // no content written outside of the f:view
        // -= Leonardo Uribe =- This section was commented because it
        // causes problems when a library try to override the default
        // PartialViewContext implementation like trinidad. Since ajax
        // stuff is only for facelets, there is no reason to keep this
        // code here. Instead, this code was moved to
        // JspViewDeclarationLanguage.buildView, because it has more sense
        // in that place.
        /*
        if (facesContext.getPartialViewContext().isPartialRequest())
        {
            // try to get (or create) a ResponseSwitch and turn off the output
            Object response = facesContext.getExternalContext().getResponse();
            ResponseSwitch responseSwitch = ExternalContextUtils.getResponseSwitch(response);
            if (responseSwitch == null)
            {
                // no ResponseSwitch installed yet - create one
                responseSwitch = ExternalContextUtils.createResponseSwitch(response);
                if (responseSwitch != null)
                {
                    // install the ResponseSwitch
                    facesContext.getExternalContext().setResponse(responseSwitch);
                }
            }
            if (responseSwitch != null)
            {
                responseSwitch.setEnabled(false);
            }
        }
        */
       
        try
        {
            // do-while, because the view might change in PreRenderViewEvent-listeners
            do
            {
                root = facesContext.getViewRoot();
                viewId = root.getViewId();
               
                ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(
                        facesContext, viewId);
                if (vdl != null)
                {
View Full Code Here

        ViewHandler viewHandler = application.getViewHandler();
       
        // Call initView() on the ViewHandler. This will set the character encoding properly for this request.
        viewHandler.initView(facesContext);

        UIViewRoot viewRoot = facesContext.getViewRoot();

        RestoreViewSupport restoreViewSupport = getRestoreViewSupport();

        // Examine the FacesContext instance for the current request. If it already contains a UIViewRoot
        if (viewRoot != null)
        {
            if (log.isLoggable(Level.FINEST))
                log.finest("View already exists in the FacesContext");
           
            // Set the locale on this UIViewRoot to the value returned by the getRequestLocale() method on the
            // ExternalContext for this request
            viewRoot.setLocale(facesContext.getExternalContext().getRequestLocale());
           
            restoreViewSupport.processComponentBinding(facesContext, viewRoot);
            return false;
        }
       
View Full Code Here

                // we have to invoke createView() on the application's ViewHandler
                // here instead of invoking it directly in FaceletVDL, because
                // the ViewHandler might be wrapped and wants to do some work
                // in createView() (e.g. in Trinidad - see MYFACES-2641)
                UIViewRoot view = context.getApplication().getViewHandler().createView(context, getViewId());
                // inside createView(context,viewId), calculateViewId() is called and
                // the result is stored inside created UIViewRoot, so we can safely take the derived
                // viewId from there.
                Facelet facelet = _getViewMetadataFacelet(view.getViewId());
                facelet.apply(context, view);

                return view;
            }
            catch (IOException ioe)
View Full Code Here

            UIComponent component) throws IOException {
        super.afterFormElementsEnd(facesContext, component);
       
        ResponseWriter writer = facesContext.getResponseWriter();
        ExternalContext extContext = facesContext.getExternalContext();
        UIViewRoot root = facesContext.getViewRoot();
       
        for (UIComponent child : root.getComponentResources(facesContext,
             FORM_TARGET)) {
            child.encodeAll (facesContext);
        }
       
        // If javascript viewstate is enabled write empty hidden input in forms
View Full Code Here

TOP

Related Classes of javax.faces.component.UIViewRoot$Events

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.