Difference between revisions of "Midware TMWTable"

From Overbyte
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
TMWTable is a TDataSet descendent so you can use it with data-aware controls such as TDBEdit and TDBGrid. Just like you use TQuery or TTable.
 
TMWTable is a TDataSet descendent so you can use it with data-aware controls such as TDBEdit and TDBGrid. Just like you use TQuery or TTable.
  
TMWTable is an interface that present MidWare communication buffer (TMWBuffer component) as a standard Delphi data table. It let you navigate thru all records and fields. You can and locate data, insert, delete or edit data. TMWTable has no storage for data: all data is stored in TMWBuffer component.
+
TMWTable is an interface that present MidWare communication buffer ([[Midware_TMWBuffer | TMWBufer]] component) as a standard Delphi data table. It let you navigate thru all records and fields. You can and locate data, insert, delete or edit data. TMWTable has no storage for data: all data is stored in [[Midware_TMWBuffer | TMWBuffer]] component.
  
 
TMWTable has no knowledge of table structure. You must specify it using FieldLayout property. You can fill this property at design time if you know what it will be at runtime, or you may fill it at runtime once you know the value. The value may be known at runtime because your client application query the application server for field layout. You may also sent field layout in first record in result set, feed it to the property and then delete it from result set.
 
TMWTable has no knowledge of table structure. You must specify it using FieldLayout property. You can fill this property at design time if you know what it will be at runtime, or you may fill it at runtime once you know the value. The value may be known at runtime because your client application query the application server for field layout. You may also sent field layout in first record in result set, feed it to the property and then delete it from result set.
Line 16: Line 16:
 
== Properties ==
 
== Properties ==
 
{|  
 
{|  
| width="140" valign="top" | [[Midware_TMWTable.Banner | Banner]] |||| The banner property is the text that is sent to the client when the connection has been established. Default value is 'Welcome to MidWare server'.
+
| width="140" valign="top" | [[Midware_TMWTable.Active | Active]] |||| Active property is TRUE when TMWTable is opened and FALSE when TMWTable is closed.  
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.ClientCount | ClientCount]] |||| Gives the actual number of connected clients.
+
| valign="top" | [[Midware_TMWTable.AppSrvClient | AppSrvClient]] |||| To execute a request at design time, TMWTable need an [[Midware_TAppSrvClient | TAppSrvClient]] component which will handle communication with MidWare application server.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.ClientCountLabel | ClientCountLabel]] |||| If assigned, this property will be used by TAppServer component to display the number of client connected.
+
| valign="top" | [[Midware_TMWTable.AutoCalcFields | AutoCalcFields]] |||| Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields during dataset processing.  
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.ClientTimeout | ClientTimeout]] |||| ClientTimeout gives the time in seconds before the server disconnect a client without activity.
+
| valign="top" | [[Midware_TMWTable.CanModify | CanModify]] |||| CanModify readonly property returns TMWTable ReadOnly value.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.ClientWSocket | ClientWSocket]] |||| ClientWSocket is a run-time read-only indexed property whose value is the reference to each connected client TClientWSocket component.
+
| valign="top" | [[Midware_TMWTable.Data | Data]] |||| Data property is a link to [[Midware_TMWBuffer | TMWBuffer]] component used to hold all data.  
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.ConnectCount | ConnectCount]] |||| ConnectCount gives the total number of connection received since server startup.
+
| valign="top" | [[Midware_TMWTable.FieldLayout | FieldLayout]] |||| FieldLayout property is used to describe columns content.  
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.DisplayMemo | DisplayMemo]] |||| If assigned, this property will be used by TAppServer component to display messages during work.
+
| valign="top" | [[Midware_TMWTable.FunctionCode | FunctionCode]] |||| FunctionCode and Params properties are the design time request. It's main purpose is to populate data aware controls link to TMWTable at design time. It can also be executed at runtime using ExecuteRequest.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.Handle | Handle]] |||| The Handle property is the windows handle for the hidden window the component uses for internal messages
+
| valign="top" | [[Midware_TMWTable.MWBufferFieldCount | MWBufferFieldCount]] |||| The number of fields. Based on FieldLayout property.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.Options | Options]] |||| Options are used by TAppServer to modify behaviour.
+
| valign="top" | [[Midware_TMWTable.ReadOnly | ReadOnly]] |||| ReadOnly property is used to get or set TMWTable read only status. See also CanModify.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.Port | Port]] |||| The port property gives the port number or service name used by the server to listen for client connection.
+
| valign="top" | [[Midware_TMWTable.RecordSize | RecordSize]] |||| The record size property gives the size of the record.  
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.RequestBroker | RequestBroker]] |||| The server component receive client requests, data parameters and send replies to client.
+
| valign="top" | [[Midware_TMWTable.Params | Params]] |||| FunctionCode and Params properties are the design time request.
 
|-
 
|-
| valign="top" | [[Midware_TMWTable.RequestCount | RequestCount]] |||| RequestCount gives the total number of requests received since server startup.
+
| valign="top" | [[Midware_TMWTable.TimeOut | TimeOut]] |||| When executing a request at design time, TMWTable will stop waiting for answer after Timeout seconds.
 +
|}
 +
 
 +
== Methods ==
 +
 
 +
{|
 +
| width="140" valign="top" | [[Midware_TMWTable.Close | Close]] |||| Close the communication with the application server.
 
|-
 
|-
 +
| valign="top" | [[Midware_TMWTable.CreateBlobStream | CreateBlobStream]] |||| Call CreateBlobStream to obtain a stream for reading and writing the value of the field specified by the Field parameter.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.DesignTimeRequest | DesignTimeRequest]] |||| DesignTimeRequest procedure will execute the request specified at design time.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.ExecuteRequest | ExecuteRequest]] |||| Call ExecuteRequest procedure to execute design time request.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.Locate | Locate]] |||| Implements a method for searching a dataset for a specified record and makes that record the current record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.Lookup | Lookup]] |||| Implements a method to retrieve field values from a record that matches specified search values.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.Send | Send]] |||| Send a FunctionCode  and Request (parmeters) to the application server.
 
|}
 
|}
 +
 +
== Events ==
 +
{|
 +
| width="140" valign="top" | [[Midware_TMWTable.AfterCancel | AfterCancel]] |||| Occurs after an application completes a request to cancel modifications to the current record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterClose | AfterClose]] |||| Occurs after an application closes a dataset.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterDelete | AfterDelete]] |||| Occurs after an application deletes a record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterEdit | AfterEdit]] |||| Occurs after an application starts editing a record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterInsert | AfterInsert]] ||||Occurs after an application inserts a new record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterOpen | AfterOpen]] |||| Occurs after an application completes opening a dataset and before any data access occurs.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.AfterScroll | AfterScroll]] |||| Occurs after an application scrolls from one record to another.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeCancel | BeforeCancel]] |||| Occurs before an application executes a request to cancel changes to the current record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeClose | BeforeClose]] |||| Occurs before an application executes a request to close the dataset.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeDelete | BeforeDelete]] |||| Occurs before an application attempts to delete the current record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeEdit | BeforeEdit]] |||| Occurs before an application enters edit mode for the current record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeInsert | BeforeInsert]] |||| Occurs before an application enters insert mode.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeOpen | BeforeOpen]] |||| Occurs before an application executes a request to open a dataset.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.BeforeScroll | BeforeScroll]] |||| Occurs before an application scrolls from one record to another.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnCalcField | OnCalcField]] |||| Occurs when an application recalculates calculated fields.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnDisplayInfo | OnDisplayInfo]] |||| Occurs when TMWTable wants to display debugging informations.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnDeleteError | OnDeleteError]] |||| Occurs when an application attempts to delete a record and an exception is raised.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnEditError | OnEditError]] |||| Occurs when an application attempts to modify or insert a record and an exception is raised.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnNewRecord | OnNewRecord]] |||| Occurs when an application inserts or appends a new dataset record.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnPostError | OnPostError]] |||| Occurs when an application attempts to modify or insert a record and an exception is raised.
 +
|-
 +
| valign="top" | [[Midware_TMWTable.OnRequestDone | OnRequestDone]] |||| Occurs when design time request has been satisfied and a result set is available.
 +
|}
 +
 +
== How To ==
 +
 +
{{Midware_Components_Footer}}

Latest revision as of 15:37, 24 May 2011

Main page -> Midware component reference -> TMWTable

Overview

unit MWdatSet.pas

TMWTable component is much like standard Delphi TTable or TQuery components. TMWTable is used as an interface between data and your program or visual interface.

TMWTable is a TDataSet descendent so you can use it with data-aware controls such as TDBEdit and TDBGrid. Just like you use TQuery or TTable.

TMWTable is an interface that present MidWare communication buffer ( TMWBufer component) as a standard Delphi data table. It let you navigate thru all records and fields. You can and locate data, insert, delete or edit data. TMWTable has no storage for data: all data is stored in TMWBuffer component.

TMWTable has no knowledge of table structure. You must specify it using FieldLayout property. You can fill this property at design time if you know what it will be at runtime, or you may fill it at runtime once you know the value. The value may be known at runtime because your client application query the application server for field layout. You may also sent field layout in first record in result set, feed it to the property and then delete it from result set.

Properties

Active Active property is TRUE when TMWTable is opened and FALSE when TMWTable is closed.
AppSrvClient To execute a request at design time, TMWTable need an TAppSrvClient component which will handle communication with MidWare application server.
AutoCalcFields Set AutoCalcFields to control when the OnCalcFields event is triggered to update calculated fields during dataset processing.
CanModify CanModify readonly property returns TMWTable ReadOnly value.
Data Data property is a link to TMWBuffer component used to hold all data.
FieldLayout FieldLayout property is used to describe columns content.
FunctionCode FunctionCode and Params properties are the design time request. It's main purpose is to populate data aware controls link to TMWTable at design time. It can also be executed at runtime using ExecuteRequest.
MWBufferFieldCount The number of fields. Based on FieldLayout property.
ReadOnly ReadOnly property is used to get or set TMWTable read only status. See also CanModify.
RecordSize The record size property gives the size of the record.
Params FunctionCode and Params properties are the design time request.
TimeOut When executing a request at design time, TMWTable will stop waiting for answer after Timeout seconds.

Methods

Close Close the communication with the application server.
CreateBlobStream Call CreateBlobStream to obtain a stream for reading and writing the value of the field specified by the Field parameter.
DesignTimeRequest DesignTimeRequest procedure will execute the request specified at design time.
ExecuteRequest Call ExecuteRequest procedure to execute design time request.
Locate Implements a method for searching a dataset for a specified record and makes that record the current record.
Lookup Implements a method to retrieve field values from a record that matches specified search values.
Send Send a FunctionCode and Request (parmeters) to the application server.

Events

AfterCancel Occurs after an application completes a request to cancel modifications to the current record.
AfterClose Occurs after an application closes a dataset.
AfterDelete Occurs after an application deletes a record.
AfterEdit Occurs after an application starts editing a record.
AfterInsert Occurs after an application inserts a new record.
AfterOpen Occurs after an application completes opening a dataset and before any data access occurs.
AfterScroll Occurs after an application scrolls from one record to another.
BeforeCancel Occurs before an application executes a request to cancel changes to the current record.
BeforeClose Occurs before an application executes a request to close the dataset.
BeforeDelete Occurs before an application attempts to delete the current record.
BeforeEdit Occurs before an application enters edit mode for the current record.
BeforeInsert Occurs before an application enters insert mode.
BeforeOpen Occurs before an application executes a request to open a dataset.
BeforeScroll Occurs before an application scrolls from one record to another.
OnCalcField Occurs when an application recalculates calculated fields.
OnDisplayInfo Occurs when TMWTable wants to display debugging informations.
OnDeleteError Occurs when an application attempts to delete a record and an exception is raised.
OnEditError Occurs when an application attempts to modify or insert a record and an exception is raised.
OnNewRecord Occurs when an application inserts or appends a new dataset record.
OnPostError Occurs when an application attempts to modify or insert a record and an exception is raised.
OnRequestDone Occurs when design time request has been satisfied and a result set is available.

How To


Midware Components Reference