Package javax.faces.lifecycle

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


       
        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

     * @param context the Faces context.
     * @param writer the response writer.
     * @throws IOException when an I/O error occurs.
     */
    protected void writeClientWindowField(FacesContext context, ResponseWriter writer) throws IOException {
        ClientWindow window = context.getExternalContext().getClientWindow();
        if (null != window) {      
            writer.startElement("input", null);
            writer.writeAttribute("type", "hidden", null);
            String clientWindowParam = ResponseStateManager.CLIENT_WINDOW_PARAM;
            UIViewRoot viewRoot = context.getViewRoot();
            if ((namespaceParameters) && (viewRoot instanceof NamingContainer)) {
                String namingContainerId = viewRoot.getContainerClientId(context);
                if (namingContainerId != null) {
                  clientWindowParam = namingContainerId + clientWindowParam;
                }
            }
            writer.writeAttribute("name", clientWindowParam, null);
            writer.writeAttribute("id", Util.getClientWindowId(context), null);
            writer.writeAttribute("value", window.getId(), null);
            if (webConfig.isOptionEnabled(AutoCompleteOffOnViewState)) {
                writer.writeAttribute("autocomplete", "off", null);
            }
            writer.endElement("input");
        }       
View Full Code Here

                (MessageUtils.getExceptionMessageString
                 (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "context"));
        }

        ExternalContext extContext = context.getExternalContext();
        ClientWindow myWindow = extContext.getClientWindow();
        if (null == myWindow) {
            myWindow = createClientWindow(context);
            if (null != myWindow) {
                myWindow.decode(context);
                extContext.setClientWindow(myWindow);
            }
        }
       
       
View Full Code Here

        private FlowScopeMapHelper(FacesContext facesContext) {
            ExternalContext extContext = facesContext.getExternalContext();
            this.sessionMap = extContext.getSessionMap();
            Flow currentFlow = getCurrentFlow(facesContext);
            if (null != currentFlow) {
                ClientWindow curWindow = facesContext.getExternalContext().getClientWindow();
                if (null == curWindow) {
                    throw new IllegalStateException("Unable to obtain current ClientWindow.  Is the ClientWindow feature enabled?");
                }
                final String clientWindow = currentFlow.getClientWindowFlowId(curWindow);
               
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

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

     * @param context the Faces context.
     * @param writer the response writer.
     * @throws IOException when an I/O error occurs.
     */
    protected void writeClientWindowField(FacesContext context, ResponseWriter writer) throws IOException {
        ClientWindow window = context.getExternalContext().getClientWindow();
        if (null != window) {      
            writer.startElement("input", null);
            writer.writeAttribute("type", "hidden", null);
            writer.writeAttribute("name", ResponseStateManager.CLIENT_WINDOW_PARAM, null);
            writer.writeAttribute("id", Util.getClientWindowId(context), null);
            writer.writeAttribute("value", window.getId(), null);
            if (webConfig.isOptionEnabled(AutoCompleteOffOnViewState)) {
                writer.writeAttribute("autocomplete", "off", null);
            }
            writer.endElement("input");
        }       
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

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.