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

          Sven Meier committed 1152497 (1 file)
          Sven Meier made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Sven Meier [ svenmeier ]
          Fix Version/s 1.5-RC6 [ 12316657 ]
          Resolution Fixed [ 1 ]
          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.
          Martin Grigorov made changes -
          Fix Version/s 1.5-M4 [ 12315483 ]
          Jeremy Thomerson made changes -
          Fix Version/s 1.5-M4 [ 12315483 ]
          Fix Version/s 1.5-M3 [ 12315329 ]
          Igor Vaynberg made changes -
          Fix Version/s 1.5-M3 [ 12315329 ]
          Fix Version/s 1.5-M2 [ 12315237 ]
          Igor Vaynberg made changes -
          Fix Version/s 1.5-M2 [ 12315237 ]
          Fix Version/s 1.5-M1 [ 12313078 ]
          Timo Rantalaiho made changes -
          Fix Version/s 1.5-M1 [ 12313078 ]
          Fix Version/s 1.4-M4 [ 12313295 ]
          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.
          Martijn Dashorst made changes -
          Fix Version/s 1.4-M4 [ 12313295 ]
          Fix Version/s 1.4-M3 [ 12312912 ]
          Hide
          Martijn Dashorst added a comment -

          Moved to next milestone release.

          Show
          Martijn Dashorst added a comment - Moved to next milestone release.
          Frank Bille Jensen made changes -
          Fix Version/s 1.4-M2 [ 12312911 ]
          Fix Version/s 1.4-M3 [ 12312912 ]
          Frank Bille Jensen made changes -
          Fix Version/s 1.4-M2 [ 12312911 ]
          Fix Version/s 1.4-M1 [ 12312523 ]
          Igor Vaynberg made changes -
          Link This issue relates to WICKET-635 [ WICKET-635 ]
          Igor Vaynberg made changes -
          Field Original Value New Value
          Affects Version/s 1.3.0-final [ 12312515 ]
          Fix Version/s 1.3.0-final [ 12312515 ]
          Fix Version/s 1.4.0-alpha [ 12312523 ]
          Igor Vaynberg created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development