View Issue Details

IDProjectCategoryView StatusLast Update
0003149JEDI VCL00 JVCL Componentspublic2005-10-02 06:56
ReporterelahnAssigned Toobones 
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 
Target VersionFixed in Version3.10 
Summary0003149: TJvValidateEdit -> AllowEmpty property added
DescriptionThe existing behaviour if an "empty" state is desired, is to set the ZeroEmpty property, which displays '' when the Value = 0. This doesn't allow for a distinction in state between "empty" and "value of 0 has been entered".

An AllowEmpty property allows Text/EditText = '', while the Value/AsInteger/AsCurrency properties return a value of 0 exactly as they would if the ZeroEmpty property were set.
Additional InformationImplementation:

In TJvCustomValidateEdit, protected:
    property AllowEmpty: Boolean read FAllowEmpty write FAllowEmpty;

At the start of TJvCustomValidateEdit.DisplayText
    if FAllowEmpty and (FEditText = '') then
      ChangeText('')
    else

Modified Property: TJvCustomValidateEdit.Value

I've added the " stored False" specifier for the Value property because Text & EditText are both being stored and storing Value as well only serves to cause validation to occur twice when loading the control. Also, when Value is stored, AllowEmpty is set and Text = '' at design time, when the program is run Value is loaded and Text is set to '0'.

In TJvValidateEdit, published:
    property AllowEmpty default False;

Side Note: I would much prefer to have AllowEmpty default True, but it is possible for that to break existing behaviour. :( If everyone is happy with default True and a release note on the next JVCL release telling people to be aware of it, then that'd be great! Otherwise, I'll deal with changing the AllowEmpty property each time I drop a new one on a form.
TagsNo tags attached.

Activities

2005-08-11 01:24

 

JvValidateEdit.pas (35,491 bytes)

2005-09-15 22:49

 

JvValidateEdit.pas_To_Replace_CVS_v1.37.zip (7,203 bytes)

elahn

2005-09-15 22:50

developer   ~0007935

Changes integrated into latest version from CVS, JvValidateEdit.pas (v1.37).

2005-09-28 20:57

 

JvValidateEdit.pas_To_Replace_CVS_v1.37_(no_comments).zip (7,154 bytes)

obones

2005-10-02 06:56

administrator   ~0007995

This is now in CVS.
Please, next time, ensure that the line endings are DOS type (0000013#10) instead of UNIX type.

Issue History

Date Modified Username Field Change
2005-08-11 01:24 elahn New Issue
2005-08-11 01:24 elahn File Added: JvValidateEdit.pas
2005-09-15 22:49 elahn File Added: JvValidateEdit.pas_To_Replace_CVS_v1.37.zip
2005-09-15 22:50 elahn Note Added: 0007935
2005-09-28 20:57 elahn File Added: JvValidateEdit.pas_To_Replace_CVS_v1.37_(no_comments).zip
2005-10-02 06:56 obones Status new => resolved
2005-10-02 06:56 obones Resolution open => fixed
2005-10-02 06:56 obones Assigned To => obones
2005-10-02 06:56 obones Note Added: 0007995