View Issue Details

IDProjectCategoryView StatusLast Update
0005456JEDI VCL00 JVCL Componentspublic2011-09-21 14:10
ReporterbongosAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.45 
Summary0005456: JvValidateEdit/JvCustomEdit OnChange event called on Component Loading
DescriptionThe OnChange event of a TjvCustomEdit derivative is called when the component is loaded which is not the behaviour that is expected.
Additional InformationRecreate 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)));

TagsNo tags attached.

Activities

bongos

2011-01-13 12:12

reporter   ~0018296

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

obones

2011-02-15 13:48

administrator   ~0018350

Please provide the zipped sources of a sample application showing this.

AHUser

2011-02-16 18:53

developer   ~0018384

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