myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Robinson (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (TRINIDAD-1828) Optimized PPR does not allow renderers to customize how children are visited
Date Thu, 10 Jun 2010 21:31:14 GMT
Optimized PPR does not allow renderers to customize how children are visited
----------------------------------------------------------------------------

                 Key: TRINIDAD-1828
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1828
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 2.0.0.3-core
            Reporter: Andrew Robinson
            Assignee: Andrew Robinson


CoreRenderer provides hooks for before and after encoding, and before and after child encoding,
but no means for a renderer to be able to control the per-child visitation. Components may
need to setup a context before and after each child, choose not to visit a given child or
not, etc. In order to fix this, I plan to:


1) create a new method on CoreRenderer:
/**
 * Hook to allow the renderer to customize the visitation of the children components
 * of a component during the visitation of a component during rendering.
 *
 * @param component the component which owns the children to visit
 * @param visitContext the visitation context
 * @param callback the visit callback
 * @return <code>true</code> if the visit is complete.
 * @see UIXComponent#visitChildren(VisitContext, VisitCallback)
 */
public boolean visitChildrenForEncoding(
  UIXComponent  component,
  VisitContext  visitContext,
  VisitCallback callback)

2) Add this code to UIXComponent to call this function in visitChildren:

  // See if this is during encoding, if so, allow the renderer to control the visitation of
  // the children so that any special encoding context may be applied around the visitation
  // of each child.
  if (_isEncodingVisit(visitContext))
  {
    Renderer renderer = getRenderer(visitContext.getFacesContext());
    if (renderer instanceof CoreRenderer)
    {
      CoreRenderer coreRenderer = (CoreRenderer)renderer;
      return coreRenderer.visitChildrenForEncoding(this, visitContext, callback);
    }
  }

This way the renderer may be involved with the visitation of each child, if desired.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message