Wicket
  1. Wicket
  2. WICKET-933

Look into removing AbstractSingleSelectChoice.NO_SELECTION_VALUE

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-final
    • Fix Version/s: 1.5-RC6
    • Component/s: wicket
    • Labels:
      None

      Description

      NO_SELECTION_VALUE is a very confusing thing. getmodelvalue() can sometimes return this value, when in fact it should return "" or null or whatever. we should look into removing NO_SELECTION_VALUE altogether. also see WICKET-635

        Issue Links

          Activity

          Hide
          Sven Meier added a comment -

          Now using empty string as other form components

          Show
          Sven Meier added a comment - Now using empty string as other form components
          Hide
          Eric Hubert added a comment - - edited

          We also stumbled across this issue as our unique model values contained negative numbers - thus no differentation between a real -1 and NO_SELECTION_VALUE has been possible. We did not see a better option than subclassing DropDownChoice (in our example) and overriding getModelValue() to circumvent this "unwanted" behaviour.
          It would be nice if you could adjust this for 1.5.

          Show
          Eric Hubert added a comment - - edited We also stumbled across this issue as our unique model values contained negative numbers - thus no differentation between a real -1 and NO_SELECTION_VALUE has been possible. We did not see a better option than subclassing DropDownChoice (in our example) and overriding getModelValue() to circumvent this "unwanted" behaviour. It would be nice if you could adjust this for 1.5.
          Hide
          Timo Rantalaiho added a comment -

          I think that the constant NO_SELECTION_VALUE might be a good name to indicate that nothing is selected, but returning -1 as the model object value is definitely strange

          Anyway, as this changes existing behavior, it's better to only fix this in 1.5, right? It's not exactly a bug and there are no votes nor watchers.

          Show
          Timo Rantalaiho added a comment - I think that the constant NO_SELECTION_VALUE might be a good name to indicate that nothing is selected, but returning -1 as the model object value is definitely strange Anyway, as this changes existing behavior, it's better to only fix this in 1.5, right? It's not exactly a bug and there are no votes nor watchers.
          Hide
          Martijn Dashorst added a comment -

          Moved to next milestone release.

          Show
          Martijn Dashorst added a comment - Moved to next milestone release.

            People

            • Assignee:
              Sven Meier
              Reporter:
              Igor Vaynberg
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development