You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Andy Schwartz <an...@gmail.com> on 2011/02/08 20:45:07 UTC

SKIP_ITERATION tree visit support

Gang -

Back in June of last year on the jsr-314-open mailing list, there was
discussion on the need for a tree visit hint to indicate that
iterating components (like UIData) should not iterate during the
visit.  At that point it was too late to add a new VisitHint enum
value to the 2.0.x specification.  As a short-term workaround, we
agreed to a compromise: we'll use a "javax.faces.visit.SKIP_ITERATION"
FacesContext property as a temporary substitute for the real
VisitHint.  (The real visit hint has been added in 2.1.)

For more info, see the following jsr-314-open thread:

http://lists.jboss.org/pipermail/jsr-314-open-mirror/2010-June/000200.html

This interim solution was implemented in Mojarra 2.0.x - though looks
like it has not made it into MyFaces yet.  I am planning to open up an
issue to request that we add this, but figured it wouldn't hurt to
ping the dev list to see whether anyone has comments/questions on this
topic.

BTW, the main reason I would like to see this hint get in is because I
need the ability to perform a skip iteration visit for my own purposes
(have a use case in ADF Faces where I need to do this).  However, I
noticed that this would also be beneficial for one use case in MyFaces
as well: PostRestoreStateEvent delivery.

Currently, PostRestoreStateEvents are delivered using a full tree
visit.  Without SKIP_ITERATION support, we end up delivering multiple
(redundant) events for components that are nested within iterating
ancestors.  One negative side effect of this: since the  "binding"
attribute resolution has been moved to UIComponent.processEvent() in
2.0, this means that in cases like this:

  <h:dataTable value="#{someModel}" var="row">
    <h:column>
      <h:ouputText binding="bean.foo"/>
    </h:column>
  </h:dataTable>

The binding setter (eg. setFoo()) is called once per-row (in 2.0)
instead of one time per request (in 2.1).  This change in behavior
between 1.2/2.0 seems like a bug that could be easily fixed with
SKIP_ITERATION visiting support.

Okay - will open an issue or two on this soon.  Interested to hear
whether anyone has thoughts on this.

Andy

Re: SKIP_ITERATION tree visit support

Posted by Andy Schwartz <an...@gmail.com>.
On Tue, Feb 8, 2011 at 4:28 PM, Martin Marinschek
<mm...@apache.org> wrote:
> certainly needs to be fixed on this side of the fence as well ;)

Looks like Leonardo has already checked in fixes for both of my
issues. That was fast. :-)

Thanks Leonardo!

Andy

Re: SKIP_ITERATION tree visit support

Posted by Martin Marinschek <mm...@apache.org>.
Hi Andy,

certainly needs to be fixed on this side of the fence as well ;)

best regards,

Martin

On 2/8/11, Andy Schwartz <an...@gmail.com> wrote:
> Decided to break this up into 2 issues:
>
> MYFACES-3036 Support SKIP_ITERATION FacesContext property
> MYFACES-3037 Children of iterating components receive multiple
> PostRestoreStateEvents
>
> A solution for the first issue would make fixing the second issue very easy.
>
> Andy
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: SKIP_ITERATION tree visit support

Posted by Andy Schwartz <an...@gmail.com>.
Decided to break this up into 2 issues:

MYFACES-3036 Support SKIP_ITERATION FacesContext property
MYFACES-3037 Children of iterating components receive multiple
PostRestoreStateEvents

A solution for the first issue would make fixing the second issue very easy.

Andy