Package javax.faces.context

Examples of javax.faces.context.ExternalContext.encodeNamespace()


   * that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
   */
  public static String convertClientId(FacesContext context, UIViewRoot root,String additionalId)
  {
    ExternalContext ec = context.getExternalContext();
    String namespace = ec.encodeNamespace(SEPARATOR);

    /*
     * In servlet world encodeNamespace does nothing -- so if we get back what we sent in then do
     * not perturn the NamingContainer Id
     */
 
View Full Code Here


*/
public class PortletAjaxViewRootRenderer extends AjaxViewRootRenderer {

  protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        ExternalContext externalContext = context.getExternalContext();
    Object namespace = externalContext.encodeNamespace("");
        // encode portletbridge window marker
    writer.startElement(HTML.DIV_ELEM, component);
    writer.writeAttribute(HTML.id_ATTRIBUTE, namespace, HTML.id_ATTRIBUTE);
        super.doEncodeBegin(writer, context, component);
    }
View Full Code Here

    } else if (implicitQueue != null) {
      options.put("implicitEventsQueue", clientId);
    }

    ExternalContext externalContext = facesContext.getExternalContext();
    String namespace = externalContext.encodeNamespace("");
    if (namespace != null && namespace.length() != 0) {
      options.put("namespace", namespace);
    }
   
    String similarityGroupingId = (String) componentAttributes.get(SIMILARITY_GROUPING_ID_ATTR);
View Full Code Here

   
    String similarityGroupingId = (String) componentAttributes.get(SIMILARITY_GROUPING_ID_ATTR);
    if (similarityGroupingId == null || similarityGroupingId.length() == 0) {
      similarityGroupingId = clientId;
    } else {
      similarityGroupingId = externalContext.encodeNamespace(similarityGroupingId);
    }
   
    options.put(SIMILARITY_GROUPING_ID_ATTR, similarityGroupingId);

    // request timeout.
View Full Code Here

   * that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
   */
  public static String getContainerClientId(FacesContext context, String additionalId)
  {
    ExternalContext ec = context.getExternalContext();
    String namespace = ec.encodeNamespace(SEPARATOR);

    /*
     * In servlet world encodeNamespace does nothing -- so if we get back what we sent in then do
     * not perturn the NamingContainer Id
     */
 
View Full Code Here

    public String createUniqueId()
    {
        ExternalContext extCtx = FacesContext.getCurrentInstance()
                .getExternalContext();
        StringBuilder bld = __getSharedStringBuilder();
        return extCtx.encodeNamespace(bld.append(UNIQUE_ID_PREFIX).append(
                _uniqueIdCounter++).toString());
    }

    /**
     * The locale for this view.
View Full Code Here

        uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
        getStateHelper().put(PropertyKeys.uniqueIdCounter, (uniqueIdCounter+1L));
        // Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.
        if(seed==null)
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString());   
        }
        // Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
        else
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(seed).toString());
View Full Code Here

            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString());   
        }
        // Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
        else
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(seed).toString());
        }
    }

    /**
     * Perform necessary actions when rendering of this component starts, before delegating to the inherited
View Full Code Here

   * that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
   */
  public static String getContainerClientId(FacesContext context, String additionalId)
  {
    ExternalContext ec = context.getExternalContext();
    String namespace = ec.encodeNamespace(SEPARATOR);

    /*
     * In servlet world encodeNamespace does nothing -- so if we get back what we sent in then do
     * not perturn the NamingContainer Id
     */
 
View Full Code Here

        uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
        getStateHelper().put(PropertyKeys.uniqueIdCounter, (uniqueIdCounter+1L));
        // Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.
        if(seed==null)
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString());   
        }
        // Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
        else
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(seed).toString());
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.