Examples of ClientWindow


Examples of javax.faces.lifecycle.ClientWindow

        }
    }
   
    public List<String> getActiveFlowMapKeys(FacesContext facesContext)
    {
        ClientWindow cw = facesContext.getExternalContext().getClientWindow();
        String baseKey = cw.getId();
        List<String> activeFlowKeys = activeFlowMapKeys.get(baseKey);
        if (activeFlowKeys == null)
        {
            return Collections.emptyList();
        }
View Full Code Here

Examples of javax.faces.lifecycle.ClientWindow

        return null;
    }

    public void createCurrentFlowScope(FacesContext facesContext)
    {
        ClientWindow cw = facesContext.getExternalContext().getClientWindow();
        String baseKey = cw.getId();
       
        FlowHandler flowHandler = facesContext.getApplication().getFlowHandler();
        Flow flow = flowHandler.getCurrentFlow(facesContext);
        String flowMapKey = flow.getClientWindowFlowId(
            facesContext.getExternalContext().getClientWindow());
View Full Code Here

Examples of javax.faces.lifecycle.ClientWindow

        activeFlowMapKeys.put(baseKey, activeFlowKeys);
    }
   
    public void destroyCurrentFlowScope(FacesContext facesContext)
    {
        ClientWindow cw = facesContext.getExternalContext().getClientWindow();
        String baseKey = cw.getId();
       
        FlowHandler flowHandler = facesContext.getApplication().getFlowHandler();
        Flow flow = flowHandler.getCurrentFlow(facesContext);
        String flowMapKey = flow.getClientWindowFlowId(
            facesContext.getExternalContext().getClientWindow());
View Full Code Here

Examples of javax.faces.lifecycle.ClientWindow

        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

Examples of javax.faces.lifecycle.ClientWindow

            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));
        viewCollection.add(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

Examples of javax.faces.lifecycle.ClientWindow

    }
   
    private String encodeWindowId(String encodedUrl)
    {
        FacesContext facesContext = getCurrentFacesContext();
        ClientWindow window = facesContext.getExternalContext().getClientWindow();
        if (window != null)
        {
            if (window.isClientWindowRenderModeEnabled(facesContext))
            {
            //TODO: Use StringBuilder or some optimization.
                Map<String, String> map = window.getQueryURLParameters(facesContext);
                if (map != null)
                {
                    for (Map.Entry<String , String> entry : map.entrySet())
                    {
                        encodedUrl = encodedUrl + ( (encodedUrl.indexOf(URL_QUERY_SEPERATOR) != -1) ?
View Full Code Here

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

Examples of javax.faces.lifecycle.ClientWindow

     * @see ExternalContext#encodeActionURL(String)
     */
    public String encodeActionURL(String url) {
        Util.notNull("url", url);
        FacesContext context = FacesContext.getCurrentInstance();
        ClientWindow  cw = context.getExternalContext().getClientWindow();
        boolean appendClientWindow = false;
        if (null != cw) {
            appendClientWindow = cw.isClientWindowRenderModeEnabled(context);
        }
        if (appendClientWindow && -1 == url.indexOf(ResponseStateManager.CLIENT_WINDOW_URL_PARAM)) {
            if (null != cw) {
                String clientWindowId = cw.getId();
                StringBuilder builder = new StringBuilder(url);
                int q = url.indexOf(UrlBuilder.QUERY_STRING_SEPARATOR);
                if (-1 == q) {
                    builder.append(UrlBuilder.QUERY_STRING_SEPARATOR);
                } else {
                    builder.append(UrlBuilder.PARAMETER_PAIR_SEPARATOR);
                }
                builder.append(ResponseStateManager.CLIENT_WINDOW_URL_PARAM).append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR).append(clientWindowId);
   
                Map<String, String> additionalParams = cw.getQueryURLParameters(context);
                if (null != additionalParams) {
                    for (Map.Entry<String, String> cur : additionalParams.entrySet()) {
                        builder.append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR);
                        builder.append(cur.getKey()).
                                append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR).
View Full Code Here

Examples of javax.faces.lifecycle.ClientWindow

        writer.startUpdate(viewStateId);
        String state = context.getApplication().getStateManager().getViewState(context);
        writer.write(state);
        writer.endUpdate();

        ClientWindow window = context.getExternalContext().getClientWindow();
        if (null != window) {
            String clientWindowId = Util.getClientWindowId(context);
            writer.startUpdate(clientWindowId);
            writer.write(window.getId());
            writer.endUpdate();
        }
    }
View Full Code Here

Examples of org.apache.deltaspike.jsf.spi.scope.window.ClientWindow

                }
            }
        }
        else
        {
            ClientWindow clientWindow = BeanProvider.getContextualReference(ClientWindow.class);
            //trigger init - might lead to a redirect -> response-complete
            String windowId = clientWindow.getWindowId(facesContext);

            if (!facesContext.getResponseComplete() && !"default".equals(windowId))
            {
                facesContext.getExternalContext().setClientWindow(new ClientWindowAdapter(clientWindow));
            }
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.