Ticket #1330 (closed task: fixed)

Opened 12 months ago

Last modified 8 months ago

NullValidator should not contain allowNull

Reported by: Mauno Haukila Owned by: Jani Laakso
Priority: undefined Milestone: User Interface Library 5.2.0 RC4
Component: undefined Version:
Keywords: Cc:
Known Issue description:
Hours estimate: Deadline (dd.mm.yyyy):
Known Issue version (since): Known Issue title:
Hours done: Depends to:
Affects documentation: no
Known Issue workaround:
Affects release notes: yes Contract:

Description

It makes no sence for NullValidator? to have allowNull option. Who would really create this validator: new NullValidator?("this warning is never shown", true);

Change History

Changed 12 months ago by Joonas Lehtinen

  • type changed from defect to task
  • milestone changed from User Interface Library 5.2 enhancement candidates to User Interface Library 5.1.x known bugs

The idea with AllowNull? property has been:

  • if true, then non-nulls are not allowed.
  • If false, only non-null:s are allowed.

This way it makes sense.

Another question is if it has been implemented correctly.... (we should check before closing this ticket). Moving to 5.1.

Changed 12 months ago by Mauno Haukila

If someone would require component where only null is allowed he/she would most probably make it null&read-only.

I'm pretty sure that if someone would REALLY require "allow-null-only" functionality he/she wouldn't find NullValidator for the purpose because of it's documentation and api.

* This validator is used for validating properties that do or do not allow null
 * values. By default, nulls are not allowed.
 *

and constructor:

/**
     * Creates a new NullValidator.
     *
     * @param errorMessage
     *                the error message to display on invalidation.
     * @param allowNull
     *                Are nulls allowed?
     */
    public NullValidator(String errorMessage, boolean allowNull) {

Changed 11 months ago by Joonas Lehtinen

  • priority changed from blocker to undefined

Changed 10 months ago by Marc Englund

  • milestone changed from User Interface Library 5.1.2 to Sprint 4 backlog

This is a documentation issue: allowNull actually means requireNull. If it makes sense or is useful is another question...

Changed 10 months ago by Joonas Lehtinen

  • milestone changed from Sprint 4 backlog to User Interface Library 5.1.2

Milestone Sprint 4 backlog deleted

Changed 9 months ago by Joonas Lehtinen

  • milestone changed from User Interface Library 5.1.2 to User Interface Library 5.2.0

Milestone User Interface Library 5.1.2 deleted

Changed 8 months ago by Marc Englund

  • status changed from new to closed
  • resolution set to fixed

Fixed in #4444 (allowNull is now onlyNullAllowed)

Note: See TracTickets for help on using tickets.