Package javax.faces.lifecycle

Examples of javax.faces.lifecycle.ClientWindow


                }
            }
        }
       
        FacesContext facesContext = getCurrentFacesContext();
        ClientWindow window = facesContext.getExternalContext().getClientWindow();
        if (window != null)
        {
            //TODO: Use StringBuilder or some optimization.
            if (window.isClientWindowRenderModeEnabled(facesContext))
            {
                Map<String, String> map = window.getQueryURLParameters(facesContext);
                if (map != null)
                {
                    for (Map.Entry<String , String> entry : map.entrySet())
                    {
                        ArrayList<String> value = new ArrayList<String>(1);
View Full Code Here


        writeWindowIdField(facesContext, responseWriter);
    }
   
    private void writeWindowIdField(FacesContext facesContext, ResponseWriter responseWriter) throws IOException
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();
        if (clientWindow != null)
        {
            responseWriter.startElement(HTML.INPUT_ELEM, null);
            responseWriter.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
            responseWriter.writeAttribute(HTML.ID_ATTR, generateUpdateClientWindowId(facesContext), null);
            responseWriter.writeAttribute(HTML.NAME_ATTR, ResponseStateManager.CLIENT_WINDOW_PARAM, null);
            responseWriter.writeAttribute(HTML.VALUE_ATTR, clientWindow.getId(), null);
            responseWriter.endElement(HTML.INPUT_ELEM);
        }
    }
View Full Code Here

        writeWindowIdField(facesContext, responseWriter);
    }
   
    private void writeWindowIdField(FacesContext facesContext, ResponseWriter responseWriter) throws IOException
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();
        if (clientWindow != null)
        {
            responseWriter.startElement(HTML.INPUT_ELEM, null);
            responseWriter.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
            responseWriter.writeAttribute(HTML.ID_ATTR, generateUpdateClientWindowId(facesContext), null);
            responseWriter.writeAttribute(HTML.NAME_ATTR, ResponseStateManager.CLIENT_WINDOW_PARAM, null);
            responseWriter.writeAttribute(HTML.VALUE_ATTR, clientWindow.getId(), null);
            responseWriter.endElement(HTML.INPUT_ELEM);
        }
    }
View Full Code Here

                }
            }
        }
       
        FacesContext facesContext = getCurrentFacesContext();
        ClientWindow window = facesContext.getExternalContext().getClientWindow();
        if (window != null)
        {
            //TODO: Use StringBuilder or some optimization.
            if (window.isClientWindowRenderModeEnabled(facesContext))
            {
                Map<String, String> map = window.getQueryURLParameters(facesContext);
                if (map != null)
                {
                    for (Map.Entry<String , String> entry : map.entrySet())
                    {
                        ArrayList<String> value = new ArrayList<String>(1);
View Full Code Here

    }
   
    @Override
    public void attachWindow(FacesContext facesContext)
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();
        if (clientWindow == null)
        {
            clientWindow = getClientWindowFactory().getClientWindow(facesContext);
        }
        if (clientWindow != null)
        {
            clientWindow.decode(facesContext);
            facesContext.getExternalContext().setClientWindow(clientWindow);
        }
    }
View Full Code Here

            if (key == null )
            {
                // Check if clientWindow is enabled and if the last view key is stored
                // into session, so we can use it to chain the precedence in GET-GET
                // cases.
                ClientWindow clientWindow = context.getExternalContext().getClientWindow();
                if (clientWindow != null)
                {
                    key = (SerializedViewKey) viewCollection.
                            getLastWindowKey(context, clientWindow.getId());
                }
                else if (isUseFlashScopePurgeViewsInSession(context.getExternalContext()) &&
                    Boolean.TRUE.equals(context.getExternalContext().getRequestMap()
                            .get("oam.Flash.REDIRECT.PREVIOUSREQUEST")))
                {
                    key = (SerializedViewKey)
                            context.getExternalContext().getFlash().get(RESTORED_VIEW_KEY_REQUEST_ATTR);
                }
            }
        }
       
        SerializedViewKey nextKey = getSessionViewStorageFactory().createSerializedViewKey(
                context, context.getViewRoot().getViewId(), getNextViewSequence(context));
        // Get viewScopeMapId
        ViewScopeProxyMap viewScopeProxyMap = null;
        Object viewMap = context.getViewRoot().getViewMap(false);
        if (viewMap != null)
        {
            while (viewMap != null)
            {
                if (viewMap instanceof ViewScopeProxyMap)
                {
                    viewScopeProxyMap = (ViewScopeProxyMap)viewMap;
                    break;
                }
                else if (viewMap instanceof FacesWrapper)
                {
                    viewMap = ((FacesWrapper)viewMap).getWrapped();
                }
            }

        }
        if (viewScopeProxyMap != null)
        {
            ViewScopeProviderFactory factory = ViewScopeProviderFactory.getViewScopeHandlerFactory(
                context.getExternalContext());
            ViewScopeProvider handler = factory.getViewScopeHandler(context.getExternalContext());
            viewCollection.put(context, serializeView(context, serializedView), nextKey, key,
                    handler, viewScopeProxyMap.getViewScopeId());
        }
        else
        {
            viewCollection.put(context, serializeView(context, serializedView), nextKey, key);
        }

        ClientWindow clientWindow = context.getExternalContext().getClientWindow();
        if (clientWindow != null)
        {
            //Update the last key generated for the current windowId in session map
            viewCollection.putLastWindowKey(context, clientWindow.getId(), nextKey);
        }
       
        // replace the value to notify the container about the change
        sessionMap.put(SERIALIZED_VIEW_SESSION_ATTR, viewCollection);
    }
View Full Code Here

                }
            }
        }
       
        FacesContext facesContext = getCurrentFacesContext();
        ClientWindow window = facesContext.getExternalContext().getClientWindow();
        if (window != null)
        {
            //TODO: Use StringBuilder or some optimization.
            if (window.isClientWindowRenderModeEnabled(facesContext))
            {
                Map<String, String> map = window.getQueryURLParameters(facesContext);
                if (map != null)
                {
                    for (Map.Entry<String , String> entry : map.entrySet())
                    {
                        ArrayList<String> value = new ArrayList<String>(1);
View Full Code Here

     * @param externalContext
     */
    private void _saveRenderFlashMapTokenForNextRequest(ExternalContext externalContext)
    {
        String tokenValue = (String) externalContext.getRequestMap().get(FLASH_RENDER_MAP_TOKEN);
        ClientWindow clientWindow = externalContext.getClientWindow();
        if (clientWindow != null)
        {
            //Use HttpSession or PortletSession object
            Map<String, Object> sessionMap = externalContext.getSessionMap();
            sessionMap.put(FLASH_RENDER_MAP_TOKEN+SEPARATOR_CHAR+clientWindow.getId(), tokenValue);
        }
        else
        {
            HttpServletResponse httpResponse = ExternalContextUtils.getHttpServletResponse(externalContext);
            if (httpResponse != null)
View Full Code Here

     * @return
     */
    private String _getRenderFlashMapTokenFromPreviousRequest(ExternalContext externalContext)
    {
        String tokenValue = null;
        ClientWindow clientWindow = externalContext.getClientWindow();
        if (clientWindow != null)
        {
            Map<String, Object> sessionMap = externalContext.getSessionMap();
            tokenValue = (String) sessionMap.get(FLASH_RENDER_MAP_TOKEN+
                    SEPARATOR_CHAR+clientWindow.getId());
        }
        else
        {
            HttpServletResponse httpResponse = ExternalContextUtils.getHttpServletResponse(externalContext);
            if (httpResponse != null)
View Full Code Here

        writeWindowIdField(facesContext, responseWriter);
    }
   
    private void writeWindowIdField(FacesContext facesContext, ResponseWriter responseWriter) throws IOException
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();
        if (clientWindow != null)
        {
            responseWriter.startElement(HTML.INPUT_ELEM, null);
            responseWriter.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
            responseWriter.writeAttribute(HTML.ID_ATTR, generateUpdateClientWindowId(facesContext), null);
            responseWriter.writeAttribute(HTML.NAME_ATTR, ResponseStateManager.CLIENT_WINDOW_PARAM, null);
            responseWriter.writeAttribute(HTML.VALUE_ATTR, clientWindow.getId(), null);
            responseWriter.endElement(HTML.INPUT_ELEM);
        }
    }
View Full Code Here

TOP

Related Classes of javax.faces.lifecycle.ClientWindow

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.