Wicket
  1. Wicket
  2. WICKET-606

AbstractTextComponent#setConvertEmptyInputStringToNull(true) does not work with IObjectClassAwareModels (affects TextField, etc.)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta1
    • Fix Version/s: 1.3.0-beta2
    • Component/s: None
    • Labels:
      None

      Description

      The unit tests ought to cover this, but apparently don't. A TextField should convert empty strings to nulls if you call setConvertEmptyInputStringToNull(true) on it (which the constructors do by default).

      However, this doesn't currently work:

      • AbstractTextComponent#getConvertEmptyInputStringToNull() is only called from AbstractTextComponent#convertValue(String[]).
      • AbstractTextComponent#convertValue(String[]) is called from FormComponent#convert(), but only if the component doesn't have a type assigned to it.
      • As soon as you use a PropertyModel (which implements IObjectClassAwareModel), this means empty strings are no longer converted to nulls.

      This is obviously a great big blocker and needs fixing ASAP.

        Issue Links

          Activity

          Gavin made changes -
          Link This issue is depended upon by WICKET-3304 [ WICKET-3304 ]
          Gavin made changes -
          Link This issue blocks WICKET-3304 [ WICKET-3304 ]
          Pedro Santos made changes -
          Link This issue blocks WICKET-3269 [ WICKET-3269 ]
          Pedro Santos made changes -
          Link This issue blocks WICKET-3304 [ WICKET-3304 ]
          Pedro Santos made changes -
          Link This issue blocks WICKET-3269 [ WICKET-3269 ]
          Alastair Maw made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Eelco Hillenius made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Alastair Maw made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Alastair Maw made changes -
          Field Original Value New Value
          Assignee Alastair Maw [ almaw ]
          Alastair Maw created issue -

            People

            • Assignee:
              Alastair Maw
              Reporter:
              Alastair Maw
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development