Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005456 [JEDI VCL] 00 JVCL Components minor always 2011-01-13 11:19 2011-09-21 14:10
Reporter bongos View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0005456: JvValidateEdit/JvCustomEdit OnChange event called on Component Loading
Description The OnChange event of a TjvCustomEdit derivative is called when the component is loaded which is not the behaviour that is expected.
Additional Information Recreate by putting TjvValidateEdit on a form, set a value and the OnChange event and run. The Onchange event is fired upon creation of the form.

I have currently fixed it for myself by changing the following:

In TjvCustomEdit.SetText(const Value: TCaption), change the line (

inherited Text := Value;

to

Perform(WM_SETTEXT, 0, LongInt(PChar(Value)));

Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0018296)
bongos (reporter)
2011-01-13 12:12

Forgot to mention slight alteration to TJvCustomValidateEdit for this bug, to set the EditText to the formatted value before considering csLoading

procedure TJvCustomValidateEdit.Loaded;
begin
  // set the EditText to the formatted value before taking csLoading from ComponentState, to allow eg.skipping of OnChange
  DataConnector.Active := False;
  try
    EditText := FEditText;
  finally
    DataConnector.Active := True;
  end;
  inherited Loaded;
  // (obones) Why is this necessary? It overrides DecimalPlaces set to 0 by the user
{ if DisplayFormat = dfCurrency then
    if FDecimalPlaces = 0 then
      FDecimalPlaces := CurrencyDecimals;}
end
(0018350)
obones (administrator)
2011-02-15 13:48

Please provide the zipped sources of a sample application showing this.
(0018384)
AHUser (developer)
2011-02-16 18:53

Fixed in svn revision 12986.

As far as I can see this can only happen if you use visual inheritance because then the OnChange event handler can be assigned before the Value property.

- Issue History
Date Modified Username Field Change
2011-01-13 11:19 bongos New Issue
2011-01-13 12:12 bongos Note Added: 0018296
2011-02-15 13:48 obones Note Added: 0018350
2011-02-15 13:48 obones Status new => feedback
2011-02-16 18:53 AHUser Note Added: 0018384
2011-02-16 18:53 AHUser Status feedback => resolved
2011-02-16 18:53 AHUser Fixed in Version => Daily / SVN
2011-02-16 18:53 AHUser Resolution open => fixed
2011-02-16 18:53 AHUser Assigned To => AHUser
2011-09-21 14:10 obones Fixed in Version Daily / SVN => 3.45


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker