TBaseMediator class
Base class for mediating data between model and view objects
Declaration
TBaseMediator = class(TComponent)Inheritance
- TBaseMediator
- TComponent
- TPersistent
- TObject
Descends from it: TBaseListMediator TComponentMediator
Description
The TBaseMediator class provides automatic data binding between model objects (subjects) and view components.
It implements the observer pattern to automatically synchronize data when either the model or view changes.
The mediator supports bidirectional data binding, read-only modes, and custom data transfer events.
Subjects must implement the IFPObserved interface,
while views must have published properties that can be accessed by name.
This class serves as the base class for more specialized mediators like list mediators and component mediators, providing common functionality for property validation, observer management, and data transfer coordination.
See also
Properties
ViewPropertyName | protected | |
Transferring | protected | |
Subject | public | Model object implementing IFPObserved interface |
View | public | View component for data display and editing |
Valuelist | public | Optional list of values for list-based mediators |
SubjectPropertyName | published | Name of property in subject object to mediate |
Active | published | Enables or disables automatic data synchronization |
ReadOnly | published | Prevents data transfer from view to subject when True |
Methods
PublishedViewProperty | protected | |
PublishedSubjectProperty | protected | |
SetActive | protected | |
SetSubject | protected | |
SetSubjectPropertyName | protected | |
ViewChangedHandler | protected | |
CheckPropertyName | protected | |
MaybeObjectToView | protected | |
MaybeViewToObject | protected | |
CheckViewSubject | protected | |
DoObjectToView | protected | |
DoViewToObject | protected | |
GetView | protected | |
ViewChanged | protected | |
ValuelistChanged | protected | |
FPOObservedChanged | protected | |
RaiseMediatorError | protected | |
Destroy | public | Destroys the mediator and cleans up observer attachments |
ObjectToView | public | Copies data from subject object to view component |
ViewToObject | public | Copies data from view component to subject object |
ViewClass | public | Returns the minimum view class this mediator can handle |
CompositeMediator | public | Indicates whether this is a composite mediator |
Events
OnViewToObject | published | Event triggered when copying data from view to subject |
OnObjectToView | published | Event triggered when copying data from subject to view |
Inherited
From TComponent (75)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle Create DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
