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

Split AutoLabelResolver into wicket:for and wicket:label

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.18, 1.5-RC6
    • 1.4.18, 1.5-RC6
    • wicket
    • None

    Description

      AutoLabelResolver is combining two different things - managing the "for" attribute in <label>, and managing FormComponent#getLabel.

      After an IRC conversation with martin-g and ivaynberg, I propose splitting this behavior into two parts, as done in the upcoming patch. Use wicket:for as before, use <wicket:label> to output or pick up the label string. See AutoFormComponentLabelResolver for details.

      AutoLabelResolver also did not play nice with Enclosure - it would confuse Enclosure and make it throw ArrayIndexOutOfBoundExceptions. That could be cured by having AutoLabelTagResolver do setAutoComponentTag=true, but that again would break AutoLabelResolver's <span> magic. By splitting it up like this, that issue is avoided, and wicket:for, wicket:label and Enclosure play nicely together.

      Attachments

        1. 0001-split-autolabelresolver.patch
          53 kB
          Carl-Eric Menzel
        2. WICKET-3903.diff
          39 kB
          Igor Vaynberg
        3. 0001-port-AutoLabelTextResolver-from-1.4.patch
          63 kB
          Carl-Eric Menzel

        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: