Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 1.2
    • Component/s: Uncategorized
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      180
    • Status Whiteboard:
      Hide

      EGEasy5 effort_moderate

      Show
      EGEasy5 effort_moderate

      Description

      Hi,

      JSF 1.2 doesn't offer a way to visit the tree in a consistent way. Many users of
      JSF have tried to go through the JSF component tree to implement some
      functionality one way or the other (the RI is no exception, see the other bug I
      opened on restoring the component binding).

      What I'd love to see (similar to the invokeOnComponent method added in 1.2) is a
      tree visitor being able to go through the tree and execute a callback method for
      every component found. As an example for a use-case, look at the comment on
      Issue #52:

      • Enhance form renderer to emit some code that scans
        down the validators attached to fields on that form,
        and emit appropriate client side javascript for the
        ones it recognizes, if the page author requests this.

      How will you go through each of the fields of the form, if you don't implement
      the visitor pattern?

      regards,

      Martin

      1. 180-TreeVisitor.zip
        61 kB
        aschwart
      2. tree-visit-round2.patch
        37 kB
        aschwart
      3. tree-visit-round3.patch
        56 kB
        aschwart

        Issue Links

          Activity

          Hide
          aschwart added a comment -

          The tree-visit-round3.patch file replaces the tree-visit-round2.patch file. It
          includes all of the changes from tree-visit-round2.patch, plus:

          • VisitContext.getIdsToVisit() has been renamed to getSubtreeIdsToVisit().
          • A new version of VisitContext.getIdsToVisit() has been added. Unlike the
            previous version (now getSubtreeIdsToVisit()), this new version returns a either
            a modifiable collection of all of the ids to visit - or, in the case of a full
            visit, the (unmodifiable) ALL_IDS collection is returned.
          • Implementations of the new getIdsToVisit() method were added to
            PartialVisitContext and FullVisitContext. The PartialVisitContext
            getIdsToVisit() implementation is interesting because we need to proxy the
            collection that we return so that we can detect modifications. We need to do
            this so that we can sync up the other collections maintained by
            PartialVisitContext when ids to visit are added or removed.
          • VisitContext.ALL_IDS is now spec'ed/implemented to throw
            UnsupportedOperationExceptions for all methods with the exception of isEmpty(),
            which always returns false.

          Please ignore the tree-visit-round2.patch - only tree-visit-round3.patch needs
          to be applied.

          Show
          aschwart added a comment - The tree-visit-round3.patch file replaces the tree-visit-round2.patch file. It includes all of the changes from tree-visit-round2.patch, plus: VisitContext.getIdsToVisit() has been renamed to getSubtreeIdsToVisit(). A new version of VisitContext.getIdsToVisit() has been added. Unlike the previous version (now getSubtreeIdsToVisit()), this new version returns a either a modifiable collection of all of the ids to visit - or, in the case of a full visit, the (unmodifiable) ALL_IDS collection is returned. Implementations of the new getIdsToVisit() method were added to PartialVisitContext and FullVisitContext. The PartialVisitContext getIdsToVisit() implementation is interesting because we need to proxy the collection that we return so that we can detect modifications. We need to do this so that we can sync up the other collections maintained by PartialVisitContext when ids to visit are added or removed. VisitContext.ALL_IDS is now spec'ed/implemented to throw UnsupportedOperationExceptions for all methods with the exception of isEmpty(), which always returns false. Please ignore the tree-visit-round2.patch - only tree-visit-round3.patch needs to be applied.
          Hide
          Ed Burns added a comment -

          Prepare to delete "spec" subcomponent.

          Show
          Ed Burns added a comment - Prepare to delete "spec" subcomponent.
          Hide
          Ed Burns added a comment -

          FIXED.

          Show
          Ed Burns added a comment - FIXED.
          Hide
          Ed Burns added a comment -

          Move all to 1.2

          Show
          Ed Burns added a comment - Move all to 1.2
          Hide
          Manfred Riem added a comment -

          Closing resolved issue out

          Show
          Manfred Riem added a comment - Closing resolved issue out

            People

            • Assignee:
              javaserverfowner
              Reporter:
              mmarinschek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: