Examples of PartialPageContext


Examples of org.apache.myfaces.trinidad.context.PartialPageContext

            // If the navigation bar that we are currently rendering
            // is included in a partial page response, add the icon
            // id to the list of partial targets.
            // =-=AEW Not sure this is still necessary
            PartialPageContext pprContext = arc.getPartialPageContext();
            if ((pprContext != null) &&
                pprContext.isInsidePartialTarget())
            {
              pprContext.addRenderedPartialTarget(iconID);
            }
          }
          else
          {
            // not in PPR mode, so just render the td (and id if not in a table)
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

  //
  // Also note that this method is overridden for the MarlinCore
  // library.  See XhtmlScriptletFactory.
  boolean __isOutsidePartialPage(RenderingContext arc)
  {
    PartialPageContext pprContext = arc.getPartialPageContext();
    if (pprContext == null)
      return false;

    return !pprContext.isInsidePartialTarget();
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

    boolean          needsQuoting,
    Object           id,
    boolean          useScript
    ) throws IOException
  {
    PartialPageContext pContext = context.getPartialPageContext();

    // cannot use t() in MarlinCore.js on a partial rendering pass
    // just render the icon.
    if (!useScript || (pContext != null))
    {
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

    if (PartialPageUtils.isPartialRenderingPass(arc))
    {
      // Mark that PPR is in fact active
      PartialPageUtils.markPPRActive(context);
      PartialPageContext pprContext = arc.getPartialPageContext();

      XhtmlRenderer.enableScriptDeferring(arc, true);

      ResponseWriter saved = context.getResponseWriter();
      ScriptBufferingResponseWriter scriptBufferingWriter =
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

  private void _renderPartialScripts(
    FacesContext                  context,
    RenderingContext           arc,
    ScriptBufferingResponseWriter scriptBufferingWriter) throws IOException
  {
    PartialPageContext pprContext = arc.getPartialPageContext();
    if (_shouldRenderPartialScripts(pprContext))
    {
      Iterator<String> targets = pprContext.getRenderedPartialTargets();
      String scripts = scriptBufferingWriter.getBufferedScripts();

      ResponseWriter writer = context.getResponseWriter();
      // For XMLDOM, write out all the PPR scripts and the
      // PPR targets as XML elements
      if (supportsXMLDOM(arc))
      {
        writer.startElement("pprscripts", null);
        if (scripts != null)
        {
          writer.write("<![CDATA[");
          writer.writeText(scripts, null);
            writer.write("]]>");
        }
        writer.endElement("pprscripts");

        writer.startElement("pprtargets",null);
        while (targets.hasNext())
        {
          String target = targets.next();
          if (pprContext.isPartialTargetRendered(target))
          {
            writer.startElement("pprtarget", null);
            writer.writeAttribute("targetid",target,null);
            writer.endElement("pprtarget");
          }
        }

        writer.endElement("pprtargets");
      }
      // Otherwise, write out the targets in a Javascript array,
      // and add a Javascript load handler to load everything up
      else
      {
        // Render the rest of the scripts if necessary
        writer.startElement("script", null);
        writer.writeAttribute("id", _PARTIAL_SCRIPTS_ID, null);
        renderScriptTypeAttribute(context, arc);

        // We comment out all of the script contents to avoid
        // executing the scripts in the iframe.  Our
        // _partialChange() onload handler will explicitly execute
        // the scripts in the parent window's context.
        writer.writeText("/*", null);

        // Render scripts
        if (scripts != null)
          writer.writeText(scripts, null);

        // Close the comment
        writer.writeText("*/", null);

        writer.endElement("script");

        Iterator<Object> libraries =
          scriptBufferingWriter.getBufferedLibraries();

        writer.startElement("script", null);
        XhtmlRenderer.renderScriptTypeAttribute(context, arc);

        writer.writeText("var ", null);
        writer.writeText(_PARTIAL_PAGE_LIBRARIES_VAR, null);
        writer.writeText("=[", null);

        boolean firstRenderedLibrary = true;
        if (libraries != null)
        {
          while (libraries.hasNext())
          {
            if (firstRenderedLibrary)
              firstRenderedLibrary = false;

            String libraryURI = libraries.next().toString();
            writer.writeText("'", null);
            writer.writeText(libraryURI, null);
            writer.writeText("',", null);
          }
        }

        // And include ScriptEval too.
        writer.writeText("'", null);
        writer.writeText(context.getExternalContext().getRequestContextPath(),
                         null);
        writer.writeText(LibraryScriptlet.getBaseLibURL(), null);
        String versionedLibraryName =
          LibraryScriptlet.getLibraryNameWithVersion(context,
                                                     _SCRIPT_EVAL_LIBRARY_NAME);
        writer.writeText(versionedLibraryName, null);
        writer.writeText(".js'", null);

        writer.writeText("];", null);

        writer.writeText("var ", null);
        writer.writeText(_PARTIAL_PAGE_TARGETS_VAR, null);
        writer.writeText("=[", null);

        // Loop through the partial targets and write out ids for any
        // rendered targets.
        boolean firstRenderedTarget = true;

        while (targets.hasNext())
        {
          String target = targets.next();
          if (pprContext.isPartialTargetRendered(target))
          {
            if (firstRenderedTarget)
              firstRenderedTarget = false;
            else
              writer.writeText(",", null);
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

  {
    FacesContext fContext = __getFacesContext();

    RenderingContext afContext = RenderingContext.getCurrentInstance();

    PartialPageContext pContext = null;

    if (afContext != null)
      pContext = afContext.getPartialPageContext();

    // find the nearest ancestor that generates html markup:
    newTarget = _getNearestPPRTarget(newTarget);

    Object savedKey = null;
    // =-=AEW Force the rowkey of a collection back to null so that the clientId
    // will be correct.  Note that in JSF 1.2, this will be unnecessary
    if (newTarget instanceof UIXCollection)
    {
      savedKey = ((UIXCollection) newTarget).getRowKey();
      if (savedKey != null)
        ((UIXCollection) newTarget).setRowKey(null);
    }

    String clientId = newTarget.getClientId(fContext);

    // Restore the row key
    if (savedKey != null)
    {
      ((UIXCollection) newTarget).setRowKey(savedKey);
    }

    _LOG.finer("Adding partial target: {0}", newTarget);

    if (pContext != null)
    {
      pContext.addPartialTarget(clientId);
    }
    else
    {
      // If we haven't built the partial context yet, maintain a list of the
      // target IDs that have requested partial update.
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

   */
  protected boolean canSkipRendering(
    RenderingContext rc,
    String           clientId)
  {
    PartialPageContext ppc = rc.getPartialPageContext();
    if ((ppc == null) ||
        ppc.isInsidePartialTarget() ||
        ppc.isPartialTarget(clientId))
      return false;

    return true;
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

  protected boolean canSkipRendering(
    FacesContext     context,
    RenderingContext rc,
    UIComponent      component)
  {
    PartialPageContext ppc = rc.getPartialPageContext();
    if ((ppc == null) ||
        ppc.isInsidePartialTarget())
      return false;

    String clientId = component.getClientId(context);
    if (ppc.isPartialTarget(clientId))
      return false;

    return true;
  }
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

    boolean             needsQuoting,
    Object              id,
    boolean             useScript
    ) throws IOException
  {
    PartialPageContext pContext = arc.getPartialPageContext();

    // cannot use t() in MarlinCore.js on a partial rendering pass
    // just render the icon.
    if (!useScript || (pContext != null))
    {
View Full Code Here

Examples of org.apache.myfaces.trinidad.context.PartialPageContext

            // If the navigation bar that we are currently rendering
            // is included in a partial page response, add the icon
            // id to the list of partial targets.
            // =-=AEW Not sure this is still necessary
            PartialPageContext pprContext = arc.getPartialPageContext();
            if ((pprContext != null) &&
                pprContext.isInsidePartialTarget())
            {
              pprContext.addRenderedPartialTarget(iconID);
            }
          }
          else
          {
            // not in PPR mode, so just render the td (and id if not in a table)
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.