Package javax.faces.lifecycle

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


        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

       
        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

            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

    // TODO: The following line is a workaround and needs to be fixed in FACES-1798.
    writeAttribute(StringPool.ID, clientWindowName, null);

    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    ClientWindow clientWindow = externalContext.getClientWindow();

    if (clientWindow != null) {
      String clientWindowId = clientWindow.getId();
      writeAttribute(StringPool.VALUE, clientWindowId, null);
    }

    writeAttribute(ATTRIBUTE_AUTOCOMPLETE, VALUE_OFF, null);
    endElement(StringPool.INPUT);
View Full Code Here

  }

  @Override
  public ClientWindow getClientWindow(FacesContext facesContext) {

    ClientWindow wrappedClientWindow = wrappedClientWindowFactory.getClientWindow(facesContext);

    if (LIFERAY_PORTAL_DETECTED) {
      return new ClientWindowLiferayImpl(wrappedClientWindow);
    }
    else {
View Full Code Here

   */
  protected String encodeClientWindowURL(FacesContext facesContext, String url) {

    if ((url != null) && (url.indexOf(ResponseStateManager.CLIENT_WINDOW_PARAM) < 0)) {

      ClientWindow clientWindow = getClientWindow();

      if ((clientWindow != null) && clientWindow.isClientWindowRenderModeEnabled(facesContext)) {

        StringBuilder urlBuilder = new StringBuilder(url);

        int queryPos = url.indexOf(StringPool.QUESTION);

        if (queryPos > 0) {
          urlBuilder.append(StringPool.AMPERSAND);
        }
        else {
          urlBuilder.append(StringPool.QUESTION);
        }

        urlBuilder.append(ResponseStateManager.CLIENT_WINDOW_PARAM);
        urlBuilder.append(StringPool.EQUAL);
        urlBuilder.append(clientWindow.getId());

        Map<String, String> queryURLParameters = clientWindow.getQueryURLParameters(facesContext);

        if ((queryURLParameters != null) && (queryURLParameters.size() > 0)) {

          Set<Entry<String, String>> entrySet = queryURLParameters.entrySet();

View Full Code Here

public abstract class BridgeRequestScopeCompat_2_2_Impl extends BridgeRequestScopeCompatImpl {

  private static final String BRIDGE_REQ_SCOPE_ATTR_CLIENT_WINDOW = "com.liferay.faces.bridge.clientWindow";

  protected void restoreClientWindow(ExternalContext externalContext) {
    ClientWindow clientWindow = (ClientWindow) getAttribute(BRIDGE_REQ_SCOPE_ATTR_CLIENT_WINDOW);
    externalContext.setClientWindow(clientWindow);
  }
View Full Code Here

    ClientWindow clientWindow = (ClientWindow) getAttribute(BRIDGE_REQ_SCOPE_ATTR_CLIENT_WINDOW);
    externalContext.setClientWindow(clientWindow);
  }

  protected void saveClientWindow(ExternalContext externalContext) {
    ClientWindow clientWindow = externalContext.getClientWindow();
    setAttribute(BRIDGE_REQ_SCOPE_ATTR_CLIENT_WINDOW, clientWindow);
  }
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.