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

DropDownChoice NO_SELECTION_VALUE static field is final

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.4
    • 1.4-RC3
    • wicket
    • None

    Description

      Lets say I do this:

      List<Option> _options = getOptions();
      someRenderer = new ChoiceRenderer() {
      ...
      }

      DropDownChoice _ddc = new DropDownChoice("dropDown", new Model((Serializable) _option),options, someRenderer);

      The Option class looks like this:

      public class Option {
      private String display_name;
      private String id;

      gettersAndSetters...
      }

      If I select an Option from the DDC, and that Option has id = -1, the AbstractSingleSelectChoice#getDefaultChoice(final Object selected) will interpret my choice as the protected static final String NO_SELECTION_VALUE = "-1" in AbstractSingleSelectChoice.java.

      The result will be that the "Choose one" option is visible in the DDC.
      Shouldn't the NO_SELECTION_VALUE be customizable?

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            ulrikh Ulrik Hagberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: