View Issue Details

IDProjectCategoryView StatusLast Update
0002567JEDI VCL00 JVCL Componentspublic2005-02-15 17:47
Reporterivan_raAssigned Tojfudickar 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.00 BETA 2 
Target VersionFixed in Version3.00 
Summary0002567: TjvFormStorage: OnSavePacement doesnt save StoredValues
DescriptionTjvFormStorage 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
TagsNo tags attached.

Activities

2005-01-28 13:47

 

Storage.zip (1,488 bytes)

jfudickar

2005-01-28 15:43

developer   ~0006306

Changed as suggested

obones

2005-02-04 01:59

administrator   ~0006384

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

jfudickar

2005-02-15 17:41

developer   ~0006502

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 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