Erro Master / Detail - Disable Control

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fgaroso
Posts: 2
Joined: Fri 29 May 2020 19:01

Erro Master / Detail - Disable Control

Post by fgaroso » Fri 29 May 2020 19:30

Master / Detail does not work in a loop when Disable Control.

Sample:

VirtualTable1.DisableControls;
VirtualTable2.DisableControls;

VirtualTable1.Append;
VirtualTable1.Edit;
VirtualTable1id.AsInteger := 1;
VirtualTable1name.AsString := 'Test #1';
VirtualTable1.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 1;
VirtualTable2item.AsString := 'Item #1 - 1';
VirtualTable2value.AsFloat := 11;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 1;
VirtualTable2item.AsString := 'Item #1 - 2';
VirtualTable2value.AsFloat := 12;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 1;
VirtualTable2item.AsString := 'Item #1 - 3';
VirtualTable2value.AsFloat := 13;
VirtualTable2.Post;



VirtualTable1.Append;
VirtualTable1.Edit;
VirtualTable1id.AsInteger := 2;
VirtualTable1name.AsString := 'Test #2';
VirtualTable1.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 2;
VirtualTable2item.AsString := 'Item #2 - 1';
VirtualTable2value.AsFloat := 21;
VirtualTable2.Post;



VirtualTable1.Append;
VirtualTable1.Edit;
VirtualTable1id.AsInteger := 3;
VirtualTable1name.AsString := 'Test #3';
VirtualTable1.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 3;
VirtualTable2item.AsString := 'Item #3 - 1';
VirtualTable2value.AsFloat := 31;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 3;
VirtualTable2item.AsString := 'Item #3 - 2';
VirtualTable2value.AsFloat := 32;
VirtualTable2.Post;



VirtualTable1.Append;
VirtualTable1.Edit;
VirtualTable1id.AsInteger := 4;
VirtualTable1name.AsString := 'Test #4';
VirtualTable1.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 4;
VirtualTable2item.AsString := 'Item #4 - 1';
VirtualTable2value.AsFloat := 41;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 4;
VirtualTable2item.AsString := 'Item #4 - 2';
VirtualTable2value.AsFloat := 42;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 4;
VirtualTable2item.AsString := 'Item #4 - 3';
VirtualTable2value.AsFloat := 43;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 4;
VirtualTable2item.AsString := 'Item #4 - 4';
VirtualTable2value.AsFloat := 44;
VirtualTable2.Post;

VirtualTable2.Append;
VirtualTable2.Edit;
VirtualTable2id.AsInteger := 4;
VirtualTable2item.AsString := 'Item #4 - 5';
VirtualTable2value.AsFloat := 45;
VirtualTable2.Post;

Memo1.Clear;

VirtualTable1.First;
while ( not VirtualTable1.Eof ) do
begin
Memo1.Lines.Add( VirtualTable1id.AsString + ' - ' + VirtualTable1name.AsString );

VirtualTable2.First;
while ( not VirtualTable2.Eof ) do
begin
Memo1.Lines.Add( '- ' + VirtualTable2item.AsString + ' (' + VirtualTable2value.AsString + ')' );

VirtualTable2.Next;
end;

VirtualTable1.Next;
Memo1.Lines.Add( '' );
end;

VirtualTable1.First;
VirtualTable2.First;

VirtualTable1.EnableControls;
VirtualTable2.EnableControls;

MaximG
Devart Team
Posts: 1530
Joined: Mon 06 Jul 2015 11:34

Re: Erro Master / Detail - Disable Control

Post by MaximG » Thu 18 Jun 2020 19:41

Thank you for the information. We will investigate the described issue and let you know the results shortly.

fgaroso
Posts: 2
Joined: Fri 29 May 2020 19:01

Re: Erro Master / Detail - Disable Control

Post by fgaroso » Fri 20 Nov 2020 20:40

Unfortunately I am at the end of the first year of the license and the problem has not been solved, unfortunately I will not renew :(

MaximG
Devart Team
Posts: 1530
Joined: Mon 06 Jul 2015 11:34

Re: Erro Master / Detail - Disable Control

Post by MaximG » Tue 24 Nov 2020 14:40

In your example, VirtualTable works correctly. TVirtualTable is TDataSet descendant
According to the Embarcadero documentation, (http://docwiki.embarcadero.com/Librarie ... leControls), the DisableControls method disables display of data from the data source associated with DataSet, which prevents the operation of MASTER/DETAIL as it is based on the TDataSource component.

Post Reply