Wicket
  1. Wicket
  2. WICKET-3673

A little heuristic for "Unable to find component" exception

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.17
    • Fix Version/s: 1.5-RC5
    • Component/s: wicket
    • Labels:
      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.

        Issue Links

          Activity

          Juergen Donnerstag made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.5-RC5 [ 12316423 ]
          Fix Version/s 1.6.0 [ 12315431 ]
          Resolution Fixed [ 1 ]
          Igor Vaynberg made changes -
          Link This issue is related to WICKET-3335 [ WICKET-3335 ]
          Juergen Donnerstag made changes -
          Assignee Juergen Donnerstag [ jdonnerstag ]
          Martin Grigorov made changes -
          Field Original Value New Value
          Fix Version/s 1.6.0 [ 12315431 ]
          Ondra Žižka created issue -

            People

            • Assignee:
              Juergen Donnerstag
              Reporter:
              Ondra Žižka
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development