Tapestry
  1. Tapestry
  2. TAPESTRY-1597

When a List is converted to a SelectModel, the keys are converted unnecessarily to strings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.6
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      Same thing as the Map problem, but a one liner:

      org.apache.tapestry.internal.TapestryInternalUtils, line 234:

      public static OptionModel toOptionModel(Object input)

      { String value = (input != null ? String.valueOf(input) : ""); return new OptionModelImpl(value, false, value); // <-- should be value, false, input (and perhaps rename value to label for consistency) }

      Cheers,
      Nick.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Thanks for the patch!

        Show
        Howard M. Lewis Ship added a comment - Thanks for the patch!
        Hide
        Nick Westgate added a comment -

        Attached patch that fixes the problem and updates 2 affected tests.
        (The changes are similar to those made for similar Map bugfix.)

        Cheers,
        Nick.

        Show
        Nick Westgate added a comment - Attached patch that fixes the problem and updates 2 affected tests. (The changes are similar to those made for similar Map bugfix.) Cheers, Nick.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Nick Westgate
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development