Ga naar inhoud

TP2WDATable

TP2WDATable is a TDataSet descendant that will use your TP2WDARemoteAdapter and contain rows of actual data.

TP2WDATable supports DynamicWhere, allowing you to restrict the data fetched from the table to one meeting a certain condition.

Properties

property description
Active Specifies whether or not this TP2WDATable is open
Adapter You must link this property up to a TP2WDARemoteAdapter component for your TP2WDATable to retrieve (and potentially update) data.
DynamicWhere Allows for you to restrict the data fetched from the table to one meeting a certain condition. See also: TP2WDATable.OnGetDynamicWhere.
Params Use Params to specify parameter values that this TP2WDATable should include with a request for data to the server.
TableName Name of the table in the schema associated with your DataService.

Methods

Because TP2WDATable is derived from TDataSet, it includes these methods.

In addition to the methods derived from TDataSet, TP2WDATable includes a method named WaitForOpen that you can use in the following manner:

procedure TForm1.DoSomething; async;
begin
  Table.Active := True;
  try
    if await(Boolean, Table.WaitForOpen) then
    begin
      Table.First;
      while not Table.EOF do
      begin
        ...
        Table.Next;
      end;
    end;
  finally
    Table.Active := False;
  end;
end;

Events

event description
BeforeApplyUpdates Fires just before this TP2WDATable will apply updates to the server.
BeforeClose Fires just before this TP2WDATable will be effectively closed.
BeforeOpen Fires just before this TP2WDATable will be effectively opened.
BeforeScroll Fires just before a scroll will happen in this TP2WDATable.
AfterApplyUpdates Fires after this TP2WDATable has applied updates to the server.
AfterClose Fires after this TP2WDATable got closed.
AfterOpen Fires after this TP2WDATable got opened.
AfterScroll Fires after this TP2WDATable's cursor scrolled to another record.
OnError Fires when an error occurs while loading, deleting, or updating data. If you don't handle this event, it is possible for this TP2WDATable to raise an exception.
OnGetDynamicWhere Fires before this TP2WDATable is retrieving data from the server and TP2WDATable.DynamicWhere is True, allowing for you to specify a DynamicWhere expression.