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
0002131 [JEDI VCL] 00 JVCL Components trivial always 2004-09-08 11:39 2006-04-05 01:20
Reporter josz View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA
Summary 0002131: TJvDBSpinEdit Value is always 0 when Field.DisplayFormat=>''
Description When for example, Field.DisplayFormat=#'%' then TJvDBSpinEdit.Value is always 0.
Example, Field.Value=4 >>> Field.DisplayText='4%' >> TJvDBSpinEdit.Value=0
To solve this behaviour replace the line in
procedure TJvDBSpinEdit.DataChange(Sender: TObject);
Text := FDataLink.Field.DisplayText;
must be
Text := FDataLink.Field.AsString;
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0007266)
obones (administrator)
2005-05-20 03:13

I'm sorry, could you post a sample application, I can't find any Field.DisplayFormat property.
Sorry for the delay answering this.
(0007273)
josz (reporter)
2005-05-20 06:43

Sorry, the example had not enough info.
The behaviour exist when the DataField property is the name of a TNumericField or is derived from it.
TNumericField has a DisplayFormat property.

The modified procedure

procedure TJvDBSpinEdit.DataChange(Sender: TObject); { Triggered when data changes in DataSource. }
begin
 if FDataLink.Field <> nil then
 begin
   if Focused and FDataLink.CanModify then
     Text := FDataLink.Field.AsString
     //modified by Jos Zonneveld sept 8, 2004
// Text := FDataLink.Field.Text
     //This is the result of formated values and wil result in Text=0
   else
   begin
     FIsNull := (FDataLink.Field.DisplayText = '');
     Text := FDataLink.Field.AsString;
     //modified by Jos Zonneveld sept 8, 2004
// Text := FDataLink.Field.DisplayText;
     //This is the result of formated values and wil result in Text=0
     if FDataLink.Editing or (FDataLink.Field.DataSet.State = dsInsert) then
       Modified := True;
   end;
 end
 else
 begin
   FIsNull := False;
   if csDesigning in ComponentState then
     Text := Name
   else
     Text := '';
 end;
end;
(0008785)
obones (administrator)
2006-03-31 05:33

A slightly enhanced version of this is ready to be put in CVS and will be as soon as it is back up at SourceForge
(0008932)
obones (administrator)
2006-04-05 01:20

This is now in CVS

- Issue History
Date Modified Username Field Change
2004-09-08 11:39 josz New Issue
2005-05-20 03:13 obones Note Added: 0007266
2005-05-20 03:13 obones Status new => feedback
2005-05-20 06:43 josz Note Added: 0007273
2006-03-31 05:33 obones Note Added: 0008785
2006-03-31 05:33 obones Status feedback => confirmed
2006-04-05 01:20 obones Status confirmed => resolved
2006-04-05 01:20 obones Resolution open => fixed
2006-04-05 01:20 obones Assigned To => obones
2006-04-05 01:20 obones Note Added: 0008932


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