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

Palette does not display a single unselected item

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.7
    • 1.5.8, 6.0.0-beta3
    • None
    • None

    Description

      In Wicket 1.5.7, if you have a Palette where the choices model returns one object and the (selected) model returns zero objects, the palette will appear empty.

      I believe this was a result of the change in WICKET-4528. In the method Recorder.updateIds, it used to look like this

      private void updateIds(final String value)
      {
      if (Strings.isEmpty(value))

      { ids = EMPTY_IDS; }

      else

      { ids = value.split(","); }

      }

      Now it looks like this

      private void updateIds(final String value)
      {
      getSelectedIds().clear();

      for (final String id : Strings.split(value, ','))

      { getSelectedIds().add(id); }

      }

      Which means that if value is "", Strings.split returns one empty string, so getSelectedIds() contains one empty string, resulting in getUnselectedList() deciding that the selected and choices lists are both size one and therefore there is nothing available to display in the unselected list.

      Attachments

        Issue Links

          Activity

            People

              svenmeier Sven Meier
              alexgrant Alex Grant
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: