The only problem I can think of is that the list of client validators
is not currently "additive" - it's a JS variable that is written
out from scratch on each re-render.  And, as a result, if you
skip part of the page, client validation would disappear for
that part.  It shouldn't be too hard to fix that design mistake.

-- Adam



On 5/14/07, Danny Robinson <[EMAIL PROTECTED]> wrote:
Adam,

Great to finally meet face-to-face at JavaOne.  During our conversation we
talked about PPR performance and how we could make some optimizations.  One
suggestion you had was to implement a naming container that didn't render
its children during a PPR request, unless one of its children was registered
for ppr update.  I've implemented this and it *seems* to be working fine.
However, I just wanted to double-check if this approach wouldn't interfere
with the saved state of the component model or any other area of the
framework?  The code  implemented is below.

Thanks,

Danny

    boolean renderChildren = true;

    if
(RequestContext.getCurrentInstance().isPartialRequest(context))
    {

      if (_LOG.isInfo())
        _LOG.info("Checking partialZone: " +
component.getClientId(context));

      // Default to not render during PPR...
      renderChildren = false;
      for (Iterator iter =
RenderingContext.getCurrentInstance()
          .getPartialPageContext().getPartialTargets();
iter.hasNext();)
      {
        String partialTarget = (String) iter.next();

        if (partialTarget.startsWith(component.getClientId(context)))
        {
          // ...Unless the container has a ppr registered child
          renderChildren = true;
          if (_LOG.isInfo())
            _LOG.info("Target found, container will render. Target: " +
component.getClientId(context));
          break;
        }
       }
    }

    if (renderChildren)
      super.encodeChildren(context, component);


--
Chordiant Software Inc.
www.chordiant.com

Reply via email to