Package javax.faces.lifecycle

Examples of javax.faces.lifecycle.ClientWindow


        this.window = window;
    }

    public static String getWindowIdFromJsf(FacesContext facesContext)
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();

        if (clientWindow != null)
        {
            return clientWindow.getId();
        }
        return null;
    }
View Full Code Here


       
        if (null == currentFlow) {
            return null;
        }
       
        ClientWindow curWindow = context.getExternalContext().getClientWindow();
        if (null == curWindow) {
            throw new IllegalStateException("Unable to obtain current ClientWindow.  Is the ClientWindow feature enabled?");
        }

        String flowBeansForClientWindow = currentFlow.getClientWindowFlowId(curWindow) + "_beans";
View Full Code Here

        FacesContext context = FacesContext.getCurrentInstance();
        ExternalContext extContext = context.getExternalContext();
        Map<String, Object> sessionMap = extContext.getSessionMap();
        Flow currentFlow = getCurrentFlow(context);

        ClientWindow curWindow = context.getExternalContext().getClientWindow();
        if (null == curWindow) {
            throw new IllegalStateException("Unable to obtain current ClientWindow.  Is the ClientWindow feature enabled?");
        }

        String creationalForClientWindow = currentFlow.getClientWindowFlowId(curWindow) + "_creational";
View Full Code Here

        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

        String toViewId = navCase.getToViewId(context);
        Map<String,List<String>> params = getParamOverrides(component);
        addNavigationParams(navCase, params);
        String result = null;
        boolean didDisableClientWindowRendering = false;
        ClientWindow cw = null;

       
        try {
            Map<String, Object> attrs = component.getAttributes();
            Object val = attrs.get("disableClientWindow");
            if (null != val) {
                didDisableClientWindowRendering = "true".equalsIgnoreCase(val.toString());
            }
            if (didDisableClientWindowRendering) {
                cw = context.getExternalContext().getClientWindow();
                if (null != cw) {
                    cw.disableClientWindowRenderMode(context);
                }
            }
           
            result = Util.getViewHandler(context).getBookmarkableURL(context,
                                                               toViewId,
                                                               params,
                                                               isIncludeViewParams(component, navCase));
        } finally {
            if (didDisableClientWindowRendering && null != cw) {
                cw.enableClientWindowRenderMode(context);
            }
        }
       
        return result;
    }
View Full Code Here

     * @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

            url.append(QUERY_STRING_SEPARATOR).append(queryString);
            hasQueryString = true;
        }
       
        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 clientWindow = cw.getId();
                if (!hasQueryString) {
                    url.append(QUERY_STRING_SEPARATOR);
                } else {
                    url.append(PARAMETER_PAIR_SEPARATOR);
                }
                url.append(ResponseStateManager.CLIENT_WINDOW_URL_PARAM).append(PARAMETER_NAME_VALUE_SEPARATOR).append(clientWindow);
   
                Map<String, String> additionalParams = cw.getQueryURLParameters(context);
                if (null != additionalParams) {
                    for (Map.Entry<String, String> cur : additionalParams.entrySet()) {
                        url.append(PARAMETER_NAME_VALUE_SEPARATOR);
                        url.append(cur.getKey()).
                                append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR).
View Full Code Here

        this.window = window;
    }

    public static String getWindowIdFromJsf(FacesContext facesContext)
    {
        ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow();

        if (clientWindow != null)
        {
            return clientWindow.getId();
        }
        return null;
    }
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

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.