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

AutoLabelResolver breaks when the label contains wicket:message or a nested component

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.4.18, 1.5-RC6
    • None
    • wicket
    • None

    Description

      AutoLabelResolver is very useful for us, but I've discovered two related problems.

      Nesting a wicket:message doesn't work.

      <label wicket:for="..."><wicket:message key="foo">bar</wicket:message></label>

      In this case I get a MarkupException, claiming that it's missing the closing tag for <label>, even though it's there. This is fixed by removing the guard that checks for RawMarkup at AutoLabel#onComponentTag. It does not seem to be breaking anything else. The cast to RawMarkup further down was a complete no-op, so it could be safely removed.

      Also, nesting an input component in its label does not work either:

      <label wicket:for="myComp"><input type="text" wicket:id="myComp"/></label>

      Here it complains about being unable to find the input component. This is fixed by making AutoLabelResolver transparent in 1.4, and by making AutoLabel into a TransparentWebMarkupContainer in 1.5.

      Patches are ready.

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              cmenzel Carl-Eric Menzel
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: