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
0002567 [JEDI VCL] 00 JVCL Components tweak always 2005-01-28 13:47 2005-02-15 17:47
Reporter ivan_ra View Status public  
Assigned To jfudickar
Priority normal Resolution fixed  
Status resolved   Product Version 3.00 BETA 2
Summary 0002567: TjvFormStorage: OnSavePacement doesnt save StoredValues
Description TjvFormStorage has 2 events useful for restore and save StoredValues. For example:

procedure TForm1.JvFormStorage1RestorePlacement(Sender: TObject);
begin
  ComboBox1.ItemIndex:=JvFormStorage1.StoredValue['CB1'];
  ComboBox2.ItemIndex:=JvFormStorage1.StoredValue['CB2'];
end;

procedure TForm1.JvFormStorage1SavePlacement(Sender: TObject);
begin
  JvFormStorage1.StoredValue['CB1']:=ComboBox1.ItemIndex;
  JvFormStorage1.StoredValue['CB2']:=ComboBox1.ItemIndex;
end;

But 2'nd procedure doesnt work - file values of 'CB1' and 'CB2' are empty. To store it I wrote 3rd operator:

  JvFormStorage1.StoredValues.SaveValues;

Why I must save values manually? Maybe there is wrong sequence in SaveFormPlacement:

procedure TJvFormPlacement.SaveFormPlacement;
begin
  if Assigned(AppStorage) then
  begin
    WriteInteger(siVersion, FVersion);
    SavePlacement;
    Save;
    FSaved := True;
  end;
end;

"Save" invoke OnSavePlacement event handler, but JvFormStorage writes stored values into file(reg, db, etc..) in SavePlacement method (before it). So, I must call SaveValues again.
Maybe more correct sequence will be next:

    Save;
    SavePlacement;

Look at example Storage.zip
Additional Information
Tags No tags attached.
Attached Files zip file icon Storage.zip [^] (1,488 bytes) 2005-01-28 13:47

- Relationships

-  Notes
(0006306)
jfudickar (developer)
2005-01-28 15:43

Changed as suggested
(0006384)
obones (administrator)
2005-02-04 01:59

Please tell is if it works.
If we don't get any answers from you in the next 7 days, we will consider this issue as resolved
(0006502)
jfudickar (developer)
2005-02-15 17:41

No further comments -> fixed

- Issue History
Date Modified Username Field Change
2005-01-28 13:47 ivan_ra New Issue
2005-01-28 13:47 ivan_ra File Added: Storage.zip
2005-01-28 15:01 jfudickar Issue Monitored: jfudickar
2005-01-28 15:01 jfudickar Status new => assigned
2005-01-28 15:01 jfudickar Assigned To => jfudickar
2005-01-28 15:43 jfudickar Note Added: 0006306
2005-01-28 15:43 jfudickar Status assigned => feedback
2005-02-04 01:59 obones Note Added: 0006384
2005-02-15 17:41 jfudickar Status feedback => resolved
2005-02-15 17:41 jfudickar Resolution open => fixed
2005-02-15 17:41 jfudickar Note Added: 0006502
2005-02-15 17:47 jfudickar Status resolved => feedback
2005-02-15 17:47 jfudickar Resolution fixed => reopened
2005-02-15 17:47 jfudickar Status feedback => resolved
2005-02-15 17:47 jfudickar Fixed in Version => 3.00
2005-02-15 17:47 jfudickar Resolution reopened => fixed


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