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

A little heuristic for "Unable to find component" exception

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.17
    • 1.5-RC5
    • wicket
    • None

    Description

      Sometimes it's easy to get lost in the structure of a page / component.
      This leads to a situation when the component is correctly created in HTML and code, but at different level, like

      form.add(new Label("foo", ...))
             add(new Label("bar", ...))
      

      instead of

      form.add(new Label("foo", ...))
            .add(new Label("bar", ...))
      

      I suggest that the component map could be searched for components with the ID which is not found where expected, and if such ID would be found at different level, it would advice the user to check whether the structure is ok instead of simply stating "not found".

      Since this is the most common cause of that exception (from my experience),
      I think this could save users from loosing time on checking typos etc, when they are out of caffeine and start doing mistakes at the end of the day

      Thanks for considering.

      Attachments

        Issue Links

          Activity

            People

              jdonnerstag Juegen Donnerstag
              pekarna Ondra Žižka
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: