Package org.apache.myfaces.trinidad.context

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


  {
    // Don't bother if PPR isn't even supported
    if (!CoreRendererUtils.supportsPartialRendering(this))
      return;

    PartialPageContext partialPageContext =
      PartialPageUtils.createPartialPageContext(fContext,
                                                context);

    _pprContext = partialPageContext;
  }
View Full Code Here

      rowKeyManager = ((UIXCollection) component).getClientRowKeyManager();
   
    Set<Object> rowKeys = null;
    String tablePrefix = clientId + NamingContainer.SEPARATOR_CHAR;
    // Search for any PPR targets that start with "<tableClientId>:"
    PartialPageContext ppc = arc.getPartialPageContext();
    Iterator<String> targets = ppc.getPartialTargets();
    while (targets.hasNext())
    {
      String target = targets.next();
      if (target == null)
        continue;
View Full Code Here

    FacesBean           bean) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();

    String formName = arc.getFormData().getName();
    PartialPageContext pprContext = arc.getPartialPageContext();

    // Write out the hidden form field that identifies which
    // form is the one being submitted
    writer.startElement("input", null);
    writer.writeAttribute("type", "hidden", null);
    writer.writeAttribute("name", CoreResponseStateManager.FORM_FIELD_NAME, null);
    writer.writeAttribute("value", formName, null);
    writer.endElement("input");

    // Check to see if this is a partial page render.  If so, we need
    // to push the ID of the postscript onto the partial target stack
    final String postscriptId = _getPostscriptId(arc, formName);
    if (pprContext != null)
    {
      if (!pprContext.isInsidePartialTarget())
      {
        pprContext.addPartialTarget(postscriptId);
      }
    }

    if (postscriptId != null)
    {
View Full Code Here

    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

    FacesBean           bean) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();

    String formName = arc.getFormData().getName();
    PartialPageContext pprContext = arc.getPartialPageContext();

    // Write out the hidden form field that identifies which
    // form is the one being submitted
    writer.startElement("input", null);
    writer.writeAttribute("type", "hidden", null);
    writer.writeAttribute("name", CoreResponseStateManager.FORM_FIELD_NAME, null);
    writer.writeAttribute("value", formName, null);
    writer.endElement("input");

    // Check to see if this is a partial page render.  If so, we need
    // to push the ID of the postscript onto the partial target stack
    final String postscriptId = _getPostscriptId(arc, formName);
    if (pprContext != null)
    {
      if (!pprContext.isInsidePartialTarget())
      {
        pprContext.addPartialTarget(postscriptId);
      }
    }

    if (postscriptId != null)
    {
View Full Code Here

            // 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

{
  public PPRResponseWriter(ResponseWriter     out,
                           RenderingContext   rc)
  {
    super(out);
    PartialPageContext pprContext = rc.getPartialPageContext();
    if (!(pprContext instanceof PartialPageContextImpl))
        throw new IllegalArgumentException();

    _state = new State((PartialPageContextImpl) pprContext);
    _xml        = new XmlResponseWriter(out, out.getCharacterEncoding());
View Full Code Here

      // =-=AEW How to pick a proper ID?

      // Write out a script;  let PPR know to use it
      String scriptId = "::launchScript";
      PartialPageContext ppContext = arc.getPartialPageContext();
      // TODO: Create the span with a bogus component where
      // getClientId() returns the scriptId;  this avoids
      // the need to downcast - you just need to
      // call addPartialTarget().  Or, come up with a better
      // PPR api to make it simpler
View Full Code Here

        // TODO: is this always indicative of something being very wrong?
        _LOG.severe("No RenderingContext has been created.");
      }
      else
      {
        PartialPageContext ppc = rc.getPartialPageContext();
        if (ppc != null)
          rw = new PPRResponseWriter(rw, rc);
      }
     
      return _addDebugResponseWriters(rw);
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.PartialPageContext

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.