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

AutoComplete textfield ignores "visible" property within hierarchy.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.2
    • 1.4.3, 1.5-M1
    • wicket-extensions
    • None

    Description

      When writing an autocomplete textfield on a form that is first visible,
      and after an ajax call rendered invisible, the autocomplete textfields
      on this form get rendered anyway in the ajax response.

      The method "renderAutocompleteHead" in AbstractAutocompleteBehavior gets executed,
      even if the AutoComplete component to which it is attached is not visible within the
      component hierarchy.

      Below the snippet of code that solved it for us ...

      In the class AbstractAutoCompleteBehavior, a test on the visibility was added.

      public void renderHead(IHeaderResponse response) {
      if(this.getComponent().isVisibleInHierarchy())

      { super.renderHead(response); renderAutocompleteHead(response); }

      }

      The error becomes visible in the debug window on the webpage.

      Attachments

        1. AutoCompleteVisibilityBug.zip
          16 kB
          Ann Baert
        2. screenshot-1.jpg
          345 kB
          Ann Baert

        Activity

          People

            jdonnerstag Juegen Donnerstag
            annb Ann Baert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: