Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3398

EnclosureContainer: configure() should be called on the child component before calling isVisible on it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.15, 1.5-RC1
    • 1.4.16, 1.5-RC2
    • wicket
    • None

    Description

      As advised by the javadoc for Component#onConfigure, we switched to this mechanism instead of overriding isVisible/isEnabled when they contain extensive logic.

      Now if we do that for a child component that will control the visibility of the EnclosureContainer, EnclosureContainer#isVisible directly calls through to #isVisible on the child component, and this may happen before #onConfigure on the child ever gets called. In our situation where we set the visibility in #onConfigure, the result of #isVisible may change during the request cycle, which may lead to undesirable and confusing results.

      The javadoc for Component#configure states that for linked components, #configure should be called on the 'other' component. Applied to EnclosureContainer, I think the correct way to handle this is that EnclosureContainer#onConfigure must be overridden in order to call child.configure(). This way, any call to #isVisible will only occur after #onConfigure has been called, the sequence is correct again.

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              ulrikem Ulrike M
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: