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

Method Component.setVisibilityAllowed should call onVisibleStateChanged()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 9.2.0, 8.11.0
    • 9.3.0, 8.12.0
    • None
    • None

    Description

      Problem is in cache of Component visibility introduced in WICKET-6839
      RFLAG_VISIBLE_IN_HIERARCHY_SET

      If we use setVisibilityAllowed instead of setVisible exception is thrown.

      org.apache.wicket.WicketRuntimeException: The component(s) below failed to render. Possible reasons could be that:
              1) you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered),
              2) if your components were added in a parent container then make sure the markup for the child container includes them in <wicket:extend>.
       

      One posible solution is to call cleaning visibility cache in method Component.setVisibilityAllowed.
      e.g.
      Method Component.setVisibilityAllowed should call onVisibleStateChanged() as method Component.setVisible does.

      All is demonstrated in github project

      https://github.com/fafejtao/wicket9.2_visibility_bug

       

      https://github.com/fafejtao/wicket9.2_visibility_bug/blob/master/src/main/java/com/mycompany/MyPanel.java#L22

      Attachments

        Issue Links

          Activity

            People

              svenmeier Sven Meier
              fafi Ondrej Fafejta
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: