Kitto.Metadata.DataView
The data-view metadata layer. Defines data views (TKDataView) and their view tables (TKViewTable) with view fields (TKViewField) that overlay model metadata, plus the view-aware in-memory store (TKViewTableStore) with its header, records and fields used to load, edit and persist data.
TKViewTables class
property Table: TKViewTable read GetTable;The owning view table.
property View: TKView read GetView;The data view this collection belongs to.
TKFilterByViewField record
Describes a reference-field lookup constrained by another field: the destination (reference) field, the source field supplying the value, and the foreign field name it matches in the referenced model.
TKViewField class
function HasModelField: boolean;True if the view field maps to a model field (not expression-only).
function GetEmptyAsNull: Boolean;Returns the effective EmptyAsNull setting (delegates to the model field).
function FindNode(const APath: string;Finds a child node, transparently resolving nodes inherited from the model field.
function IsAccessGranted(const AMode: string): Boolean;Returns True if access is granted to this field in the given mode.
function GetResourceURI: string;The access-control resource URI identifying this field.
function CanEditField(const AInsertOperation: Boolean): Boolean;True if the field is editable in the given operation (insert vs update), per ACL and Can* flags.
property Table: TKViewTable read GetTable;The view table this field belongs to.
property Model: TKModel read GetModel;The model the field ultimately maps to.
property ModelField: TKModelField read GetModelField;Returns a reference to the model field, or raises an exception if the model field is not found.
function FindModelField: TKModelField;Returns a reference to the model field, or nil.
property Alias: string read GetAlias;Optional SQL alias for the field (the part after a space in the Name).
property AliasedName: string read GetAliasedName;The field's name as used to key it in the store (alias, or field name).
property QualifiedAliasedDBNameOrExpression: string read GetQualifiedAliasedDBNameOrExpression;Table-qualified aliased DB name, or the expression for a computed field.
property DBName: string read GetDBName;The physical DB column name.
property AliasedDBName: string read GetAliasedDBName;DB column name plus, if different from the logical name, the alias.
property QualifiedAliasedDBName: string read GetQualifiedAliasedDBName;Table-qualified AliasedDBName.
property QualifiedDBName: string read GetQualifiedDBName;DB column name prefixed with the table name (table.column).
property QualifiedDBNameOrExpression: string read GetQualifiedDBNameOrExpression;QualifiedDBName, or the SQL expression for a computed field.
property DBNameOrExpression: string read GetDBNameOrExpression;DBName, or the SQL expression for a computed field.
property AllowedValues: TEFPairs read GetAllowedValues;Fixed list of allowed value/label pairs, if any.
property FieldNamesForUpdate: string read GetFieldNamesForUpdate;If the field is referenced, returns the names of the key fields in the reference, separated by TKConfig.Instance.MultiFieldSeparator. Otherwise, returns the FieldName.
property IsReference: Boolean read GetIsReference;Returns True if the field is a reference field, that is if the field is part of the containing view table's model and the underlying model field is a reference field.
property IsAutoAddField: Boolean read GetIsAutoAddField;Returns True if the field is a auto-add field, that is if into field name there is a dot that separate Master Table e Referenced Table.
property DefaultFilter: string read GetDefaultFilter;Optional filter to use when creating select lists. Only applies to reference fields.
property LookupFilter: string read GetLookupFilter;Optional filter to use when creating lookup lists. Only applies to reference fields.
property FieldsNode: string read GetFieldsNode;RTTI carrier for the Fields node: the constituent sub-fields shown for a reference field. Read node by node at render time.
property DefaultFilterConnector: string read GetDefaultFilterConnector;Specifies the logical connector to use when appending the DefaultFilter to an existing WHERE clause (for example, a referenced model's own DefaultFilter). Defaults to 'and'; another common value is 'or'.
function GetActualDataType: TEFDataType;Returns the field's DataType, unless it's a reference field, in which case returns the data type of the referenced model's CaptionField.
property ReferenceField: TKModelField read GetReferenceField;If the field is from a different model than the table's model, returns the model field that references its model, otherwise returns nil.
property IsDetailReference: Boolean read GetIsDetailReference;Returns True if the field is the reference field of MasterTable's model's detail reference to this vie wtable's model.
IOW, returns True if the view table is a detail table and the field is (part of) the link to its master table.
function CreateReferenceStore: TKStore;Creates a store with the current field, all key fields of the referenced model and a concatenation of all key fields (if > 1) stored as a single field (used by lookups). If the field is not a reference field, an exception is raised.
function CreateReferencedModelStore(const AKeyValues: Variant): TKStore;Creates a store with all fields from the referenced model and fetches the record specified by the key values.
property ModelName: string read GetModelName;Extract and returns the model name from the Name. If no model name is specified (because the field is part of the main model), returns the main model name.
property ReferenceName: string read GetReferenceName;Extract and returns the reference name from the Name, or '' if the field is not a reference field.
property FieldName: string read GetFieldName;Extract and returns the field name without the model name qualifier. If the field is part of the main model, this is equal to Name.
property IsKey: Boolean read GetIsKey;True if the field is part of the model's primary key.
procedure AppendDefaultValues(const ANode: TEFNode);Appends to ANode one child node for each default value. Regular fields have at most one default value (returned by the DefaultValue property), while reference fields can have more (one for each physical constituent field). Model fields are queries for default values automatically.
property DataType: TEFDataType read GetDataType;The field's data type.
property FieldType: TFieldType read GetFieldType;The corresponding VCL TFieldType.
property ActualDataType: TEFDataType read GetActualDataType;The data type, resolved to the referenced caption field's type for references.
property Size: Integer read GetSize;The field size (e.g. string length); 0 when not applicable.
property IsBlob: Boolean read GetIsBlob;True if the field holds binary (blob) data.
procedure EnumRules(const AEnumFunc: TFunc<TKRuleImpl, Boolean>);Calls the specified function once for each view-level and then each model-level rule that is not overridden at the view level. The function should do something with the rule implementation object it receives (most commonly apply the rule) and return True as long as the call chain should proceed, or False to stop the rule enumeration. Generally the function will return True in the most common cases.
function HasServerSideRules: Boolean;True if the either the view or the model field has at least one server-side rule. Used to decide whether to make an async call or not when the field changes on the client.
function GetDerivedFields: TArray<TKViewField>;If the field is a reference field, creates and returns an array of view fields in the current view table from the same referenced model (including itself).
<exception cref="Assert"> Violation if IsReference is False. </exception>
If the field is a reference field called City, then all fields
called City.* are added to the returned array, plus itself (City).function CreateDerivedFieldsStore(const AKeyValues: string): TKStore;Creates and loads a store with a record containing all derived values for a reference field. The caller is responsible for freeing the store object.
<exception cref="Assert"> If the field is not a reference field, an assertion violation is raised. </exception>
Parameters:
AKeyValues— Key values for the record to fetch.
property FileNameField: string read GetFileNameField;For blob or file reference fields, optionally specifies the name of another field in the same view table that will store the original file name upon upload.
function DerivedFieldsExist: Boolean;Returns True if any view fields exist in the view table that have this field's model field as reference field. Used to discover if there are any fields that need to be refreshed when the current field's value changes.
function GetColorsAsPairs: TEFPairs;Returns the field's value→color rules as value/color pairs (for conditional coloring).
function GetFilterByFields: TArray<TKFilterByViewField>;For a reference field with FilterBy nodes, returns the (destination, source, foreign-field) tuples that constrain the lookup by another field's value.
function BuildSortClause(const AIsDescending: Boolean): string;Translate and returns a sort clause suitable for ordering a set of records on this field.
function GetURLFieldName: string;Returns the companion field name that holds a URL for this field (URL_PREFIX + name).
class function IsURLFieldName(const AFieldName: string): Boolean;True if AFieldName is a URL companion field name (starts with URL_PREFIX).
TKViewFields class
property Table: TKViewTable read GetTable;The view table owning these fields.
property FieldCount: Integer read GetFieldCount;Number of view fields.
property Fields[I: Integer]: TKViewField read GetField;The view fields, by index (default property).
TKViewTableStore class
A view-aware in-memory store for a view table: loads a set or page of records from the database (with count), appends and locates records by key, and carries the master record when it is a detail store.
constructor Create(const AViewTable: TKViewTable);Creates a store bound to the given view table (builds its header).
property MasterRecord: TKViewTableRecord read FMasterRecord write FMasterRecord;The master record when this is a detail store (else nil); drives {MasterRecord.*}.
property ViewTable: TKViewTable read FViewTable;The view table this store holds data for.
property Header: TKViewTableHeader read GetHeader;The store header (view-aware fields).
property Records: TKViewTableRecords read GetRecords;The records (typed as TKViewTableRecords).
function Load(const AFilter: string = '';Loads a page of data according to AFrom and AFor arguments, and returns the total number of records in all pages.
This method will perform two database queries, one to get the total count and one to get the requested data page.
If AFrom or ATo are 0, the method calls Load.
Parameters:
AFilter— Additional SQL filter.AFrom— Number of the first record to retrieve (0-based).ATo— Maximum count of records to retrieve.
function AppendRecord(const AValues: TEFNode): TKViewTableRecord;Appends a record and fills it with the specified values.
function GetRecord(const AKey: TEFTree;Locates and returns a record from the key values stored in AKey. Raises an exception if the record is not found.
Parameters:
AKey— Object containing at least one top-level pair for each key value.AFormatSettings— Used to interpret string values (all pair values are read as string and then converted according to this settings object).AValueIndex— If each pair in AKey contains more than one value, set this param to an index >=0 to consider that value. Normally each pair contains a single value, so you just don't pass this param.
function FindRecord(const AKey: TEFTree;Like GetRecord, but returns nil instead of raising when the record is not found.
TKViewTableHeader class
The header (field descriptors) of a view-table store.
function AddField(const AFieldName: string): TKViewTableHeaderField;Adds a header field with the given name and returns it.
property Fields[I: Integer]: TKViewTableHeaderField read GetField;The header fields, by index.
function FindField(const AFieldName: string): TKViewTableHeaderField;Returns the header field with the given name, or nil.
function FieldByName(const AFieldName: string): TKViewTableHeaderField;Returns the header field with the given name; raises if absent.
TKViewTableHeaderField class
A header field of a view-table store, bound to a view field (and the underlying model field), caching a few view-level display flags.
function SetViewField(const AValue: TKViewField;Binds the header field to a view field (optionally overriding the data type). Returns Self.
function SetModelField(const AValue: TKModelField): TKViewTableHeaderField;Binds the header field to a model field. Returns Self.
property ViewField: TKViewField read FViewField;The bound view field.
property ViewFieldIsPassword: Boolean read FViewFieldIsPassword;Cached ViewField.IsPassword (masking flag).
property ViewFieldDisplayTemplate: string read FViewFieldDisplayTemplate;Cached ViewField.DisplayTemplate.
property ModelField: TKModelField read FModelField;If the ViewField is a reference field, this property stores either:
- ViewField.ModelField (if it's the reference field itself, e.g. Customer), or
- The actual model field (if it's a physical field that was expanded as part of the reference, e.g. Customer_Id). If ViewField is not a reference field, this property always stores ViewField.ModelField.
TKViewTableField class
A field of a record in a view-table store, aware of its view field and applying view-level rendering (password masking, display template).
function GetEmptyAsNull: Boolean;Returns the effective EmptyAsNull setting (delegates to the view field).
function GetAsJSONValue(const AForDisplay: Boolean;View-aware JSON value: applies password masking and DisplayTemplate expansion.
property ParentRecord: TKViewTableRecord read GetParentRecord;The record that owns this field (typed).
property HeaderField: TKViewTableHeaderField read GetHeaderField;The view-table header field describing this field.
property ViewField: TKViewField read GetViewField;The view field this store field maps to.
property ModelField: TKModelField read GetModelField;<seealso>TKViewTableHeaderField.ModelField</seealso>
function IsPhysicalPartOfReference: Boolean;True if ViewField.IsReference and (ModelField <> ViewField.ModelField).
TKViewTableRecord class
A record in a view-table store. Adds view-aware behavior on top of TKRecord: detail stores, reference/derived-value refresh, rule application (new/edit/duplicate/before/after), field-value expansion and typed field access.
procedure FieldChanging(const AField: TKField;Called before a field's value changes; can veto the change via ADoIt.
procedure FieldChanged(const AField: TKField;Called after a field's value changed; refreshes derived reference values.
property Records: TKViewTableRecords read GetRecords;The record collection this record belongs to (typed).
property Store: TKViewTableStore read GetStore;The store owning this record (typed).
property ViewTable: TKViewTable read GetViewTable;The view table this record belongs to.
procedure EnsureDetailStores;Creates the detail stores (one per detail table) if not already present.
procedure LoadDetailStores;Loads the detail stores' rows from the database for this master record.
property DetailStores[I: Integer]: TKViewTableStore read GetDetailsStore;The detail (child) stores, by index (typed).
function AddDetailStore(const AStore: TKViewTableStore): TKViewTableStore;Attaches a detail store to this record and returns it.
procedure Refresh(const AStrict: Boolean = False);Reloads this record's values from the database (AStrict raises if it vanished).
procedure SetDetailFieldValues(const AMasterRecord: TKViewTableRecord);Propagates the master record's key onto this (detail) record's FK fields.
procedure RefreshDerivedReferenceValues;Refreshes the derived values (caption + AutoAddFields) of the reference fields whose foreign key is set but whose caption is still empty, by querying the referenced model. Mirrors what FieldChanged does per-field, but can be invoked explicitly after a bulk populate (where change notifications are disabled), so reference captions appear immediately for freshly-added in-memory records.
procedure RefreshMasterReferenceValues;Fills the values this record shows through its reference to its own master -- the caption and the reference's derived (AutoAddFields) fields -- from the master record in memory, instead of querying the referenced model.
RefreshDerivedReferenceValues resolves those with a select, which cannot work while the master has no row yet, and the master record is right there in the store. None of these values is a column of the detail's own table -- they are what its join brings in -- so filling them changes what is shown, never what is written. Idempotent, and meant to be called again on every render: the master may have been edited after the detail row was added.
function FindDetailStoreByModelName(const AModelName: string;Returns the detail store for the given model name, or nil (AForceLoad loads its rows).
function GetDetailStoreByModelName(const AModelName: string;Like FindDetailStoreByModelName but raises if not found.
procedure HandleDeleteFileInstructions;Executes the deferred file-deletion instructions for FileReference fields.
procedure ApplyNewRecordRules(const AFireFieldChangeRules: Boolean = True);Applies the model/view new-record rules (defaults, computed values). AFireFieldChangeRules keeps the AfterFieldChange cascade alive while they run, so that a value a NewRecord rule assigns triggers the rules that depend on it; pass False for batch paths that must not run them (see the remarks). In Kitto1 the cascade was on for a record being prepared for a form, because the form controller installed its field-change handler before applying these rules (Kitto.Ext.Form.pas, EnableFieldChangeHandler then ApplyNewRecordRules) and kept it for the whole life of the form, and off for the Excel import, which applied the rules on a record with no handler attached (Kitto.Excel.pas). The default preserves the first, far more common case.
procedure ApplyNewRecordRulesAndFireEvents(const AViewTable: TKViewTable;Same as ApplyNewRecordRules but also fires the model's Before/AfterNewRecord events.
procedure ApplyEditRecordRules;Applies the edit-record rules (on transition to edit mode).
procedure ApplyAfterShowEditWindowRules;Applies the rules to run after the edit window is shown.
procedure ApplyDuplicateRecordRules;Applies the duplicate-record rules (on a clone/duplicate operation).
procedure InitAsCloneOf(const ASource: TKViewTableRecord);Initializes this (freshly appended) record as a clone of ASource: copies all values except the key fields, whose default values are re-applied so that generated keys (%COMPACT_GUID% and the like) get a fresh value, then fires the new-record rules and events with AIsCloned=True. The record is left in the rsNew state, so persisting it issues an INSERT. Mirrors Kitto1's TKExtFormPanelController.StartOperation (clone branch).
procedure ApplyBeforeRules;Applies the BeforeAddOrUpdate rules (e.g. updating the master from details).
procedure ApplyAfterRules;Applies the AfterAddOrUpdate rules (post-persist side effects).
property Fields[I: Integer]: TKViewTableField read GetField;The record's fields, by index (typed; default property).
function FindField(const AFieldName: string): TKViewTableField;Returns the field with the given name, or nil (typed).
function FieldByName(const AFieldName: string): TKViewTableField;Returns the field with the given name; raises if absent (typed).
function FindFieldByDBColumnName(const ADBColumnName: string): TKViewTableField;Finds the scalar field that maps to the given physical DB column, looking through the scalar sub-fields expanded from reference fields. Returns the scalar (sub-)field, never the reference field itself, so its value can be bound as a parameter. Returns nil if not found.
function FieldByDBColumnName(const ADBColumnName: string): TKViewTableField;Like FindFieldByDBColumnName but raises if no field is found.
procedure ExpandFieldJSONValues(var AText: string;Replaces all field name markers in AText with the current field values in JSON format. A field name marker is in the form {FieldName}. Pass True in AEmptyNulls to expand null fields to empty strings, otherwise they are expanded as 'null'. If ASender is specified, then the value of the corresponding field is not expanded (useful to avoid infinite recursion when this method is called by TKViewTableField.GetAsJSONValue).
procedure ExpandExpression(var AExpression: string);Replaces occurrencess of {FieldName} tags in the specified string with actual field values, formatted as strings. If the record's store has a master record, this method also replaces occurrences of {MasterRecord.FieldName} with string representations of master record field values.
TKViewTableRecords class
The collection of records of a view-table store (typed).
property Store: TKViewTableStore read GetStore;The store owning this collection (typed).
function Append: TKViewTableRecord;Appends a new (empty) record and returns it (typed).
function AppendAndInitialize: TKViewTableRecord;Appends a new record and initializes its fields from the header (typed).
property Records[I: Integer]: TKViewTableRecord read GetRecord;The records, by index (typed; default property).
function FindRecord(const AValues: TEFNode): TKViewTableRecord;Returns the record matching the key values in AValues, or nil (typed).
function GetRecord(const AValues: TEFNode): TKViewTableRecord;Returns the record matching the key values in AValues; raises if absent (typed).
TKGroupingShowCountConfig class
ShowCount sub-node inside Grouping. YAML path: Controller/Grouping/ShowCount
TKGroupingConfig class
Grouping configuration for list controllers. YAML path: Controller/Grouping
property Aggregates: string read GetAggregates;RTTI carrier for the Aggregates node: per-column aggregate functions (sum/count/...) shown in each group header. Read by path.
TKPopupWindowConfig class
Popup window dimensions for form controllers. YAML path: Controller/PopupWindow
TKFormControllerButtonConfig class
Custom button inside a FormController. YAML path: Controller/FormController/Button
TKFormControllerConfig class
Form controller behaviour settings. YAML path: Controller/FormController
TKToolViewItem class
TKFilterItemFreeSearch class
Free-text search filter. YAML path: Filters/Items/FreeSearch
TKFilterItemDynaList class
Dynamic list filter populated by a SQL query. YAML path: Filters/Items/DynaList
TKFilterItemDateSearch class
Date-range search filter. YAML path: Filters/Items/DateSearch
TKFilterItemList class
Static list filter with predefined items. YAML path: Filters/Items/List
property Items: string read GetItems;RTTI carrier for the Items node: the predefined options, each a named entry (label as value) carrying an Expression. Read node by node at filter-build time; the getter is unused.
TKFilterItemApplyButton class
Apply/Search button in a filter panel. YAML path: Filters/Items/ApplyButton
TKFilterItemColumnBreak class
Column break in filter panel layout. YAML path: Filters/Items/ColumnBreak
TKFilterItemSpacer class
Spacer element in a filter panel. YAML path: Filters/Items/Spacer
TKFilterItemsConfig class
Container of the filter items under a List controller's Filters panel. Each child is one filter item of the type named by its node; the node is resolved to its descriptor class (below) so KIDE renders the per-type editor. YAML path: Controller/Filters/Items
TKFilterPanelConfig class
Filter panel configuration for List controllers. YAML path: Controller/Filters
Filters:
DisplayLabel: Search
LabelWidth: 80
Connector: and
Collapsed: False
Items:
FreeSearch: ...TKEditControllerConfig class
Settings of the embedded edit form of a ViewTable (the form opened to add/edit a record). YAML path: EditController.
property ApplyButton: string read GetApplyButton;RTTI carrier for the ApplyButton node (an Apply button that saves without closing the form). Read node by node at render time.
TKViewTableControllerConfig class
Controller-level settings for a ViewTable list controller. YAML path: Controller
property Grid: string read GetGrid;RTTI carrier for the Grid node: selects the grid layout (its Layout child names it; see TKViewTable.FindLayout('Grid')).
property Add: string read GetAdd;RTTI carrier for the Add toolbar-action options node (e.g. Controller/Add/Tooltip).
property Form: string read GetForm;RTTI carrier for the Form node: selects the edit-form layout (child Layout names it; see TKViewTable.FindLayout('Form')). The getter is unused; the node is read directly at render time.
TKViewTable class
function GetDefaultDisplayLabel: string;The default display label (the model's, beautified).
function FindNode(const APath: string;Finds a child node, transparently resolving values inherited from the model.
property IsDetail: Boolean read GetIsDetail;True if this view table is a detail of another (master) view table.
property MasterTable: TKViewTable read GetMasterTable;The master view table when IsDetail, otherwise nil.
function HasModelName: Boolean;True if a Model name is specified for this table.
property ModelDetailReferenceName: string read GetModelDetailReferenceName;If the view table is a detail, this property contains the name of the detail reference in the master view table's model. Otherwise it's empty.
property ModelDetailReference: TKModelDetailReference read GetModelDetailReference;If the view table is a detail, this property returns the model detail reference in the master view table's model. Otherwise raises an exception. Check IsDetail before calling this method, if you want to avoid exceptions.
property Model: TKModel read GetModel;The model this view table is based on. Raises, naming the table and the view, when there is none: a caller that reaches this without checking has assumed a table that the metadata does not declare. Use FindModel where having no model is a legitimate outcome.
function FindModel: TKModel;The model this view table is based on, or nil when it declares none.
A data view without a Model is a normal shape, not a broken one: 'Type: Data' picks the metadata class, so that the node tree has MainTable/Fields semantics and the controller is a data controller, but it promises no table. A Dashboard, a ChartPanel or a tool panel draws its own content -- for the dashboard, the views listed under Items -- and never has one. Anything that only DECORATES a table (its label, its image) must therefore degrade quietly instead of raising, which is what GetImageName, GetPluralDisplayLabel and GetDefaultDisplayLabel now do.
property FieldCount: Integer read GetFieldCount;Number of view fields.
property Fields[I: Integer]: TKViewField read GetField;The view fields, by index.
property FieldList: TKViewFields read GetFields;The view fields collection. Exposed (in addition to the indexed accessor) so the YAML 'Fields' container is discoverable via RTTI by the tree validator and the KIDE/MCP metadata tooling.
function GetFieldNames: TStringDynArray;Returns all view field names (aliased), in order.
function FindField(const AName: string): TKViewField;Returns the field with the given name, or nil.
function FieldByName(const AName: string): TKViewField;Returns the field with the given name; raises if absent.
function FieldByAliasedName(const AAliasedName: string): TKViewField;Returns the field with the given aliased name; raises if absent.
function FindFieldByAliasedName(const AAliasedName: string): TKViewField;Returns the field with the given aliased name, or nil.
function FindFieldByDBColumnName(const ADBColumnName: string): TKViewField;Returns the field mapping the given DB column, or nil.
function FieldByDBColumnName(const ADBColumnName: string): TKViewField;Returns the field mapping the given DB column; raises if absent.
function FindFieldByModelField(const AModelField: TKModelField): TKViewField;Returns the view field matching the specified model field, or nil.
function FieldByModelField(const AModelField: TKModelField): TKViewField;Returns the view field matching the specified model field, or raises an exception.
function FieldsByModelFields(const AModelFields: TKModelFieldArray): TKViewFieldArray;Returns the view fields matching the given model fields.
function FindParentField(const AFieldName: string): TKViewField;If a field with the specified name is contained in a parent field (at the model level), returns a reference to the parent field, otherwise nil.
function GetKeyFieldAliasedNames: TStringDynArray;Returns the aliased names of the key fields.
function GetFieldArray(AFilter: TFunc<TKViewField, Boolean>): TArray<TKViewField>;Returns the view fields satisfying AFilter.
function IsFieldVisible(const AField: TKViewField): Boolean;True if the field is visible in this view table.
property PreventAdding: Boolean read GetPreventAdding;Effective PreventAdding: the view's Controller/PreventAdding if specified, else the Model's PreventAdding (fallback). Used by the GUI to hide the Add button. The REST API enforces the Model-level flag directly.
property PreventEditing: Boolean read GetPreventEditing;Effective PreventEditing (view Controller if specified, else Model).
property PreventDeleting: Boolean read GetPreventDeleting;Effective PreventDeleting (view Controller if specified, else Model).
property DefaultFilter: string read GetDefaultFilter;Optional fixed filter expression to apply when building the select SQL statement to display data. Should refer to fields through qualified names. Defaults to ''.
property DefaultSorting: string read GetDefaultSorting;Optional fixed ORDER BY expression to apply when building the select SQL statement to display data. Should refer to fields through qualified names (or ordinal numbers for expression-based fields). Defaults to Model.DefaultSorting.
property DetailTableCount: Integer read GetDetailTableCount;Number of detail (child) tables.
property DetailTables[I: Integer]: TKViewTable read GetDetailTable;The detail (child) tables, by index.
property DetailTableList: TKViewTables read GetDetailTables;The detail tables collection. Exposed (in addition to the indexed accessor) so the YAML 'DetailTables' container is discoverable via RTTI by the tree validator and the KIDE/MCP metadata tooling.
function DetailTableByName(const AName: string): TKViewTable;Returns the detail table with the given name; raises if absent.
function GetDetailTableIndex(const AViewTable: TKViewTable): Integer;Returns the index of the given detail table, or -1.
procedure AddDetailTable(const AViewTable: TKViewTable);Adds a detail table to this view table.
property View: TKDataView read GetView;The data view that owns this view table.
function GetNamePath: TStringDynArray;Returns an array with any view table's model name (except the view's MainTable, which is assumed implicit) downto and including the current view table's name.
<para>Called on the Parties view's MainTable yields an empty array</para>
<para>Called on its only detail table yields 'Invitation'</para>function FindLayout(const AKind: string): TKLayout;Finds and returns a reference to a layout named after the view's PersistentName plus an underscore ('_') and the specified kind. If no layout exists under that name, returns nil.
Parameters:
AKind— Kind of layout to look for. Common kinds are 'List' and 'Form'.
function CreateStore: TKViewTableStore;Creates and returns a store with the view's metadata.
function GetDefaultValues(const AKeyOnly: Boolean = False): TEFNode;Creates and returns a node with one child for each default value as specified in the view table or model. Any default expression is evaluated at this time.
The caller is responsible for freeing the returned node object.
function GetResourceURI: string;The access-control resource URI identifying this view table.
function IsAccessGranted(const AMode: string): Boolean;Returns True if access is granted to this view table in the given mode.
procedure ApplyRules(const AApplyProc: TProc<TKRuleImpl>);Calls AApplyProc for each rule implementation of this view table (view + model).
function ApplyFieldAliasedName(const AFieldName: string): string;If the specified field exists in the view table, the method returns its AliasedName, otherwise the specified field name is returned.
function GetFilterByFields(APredicate: TFunc<TKFilterByViewField, Boolean>): TArray<TKFilterByViewField>;Returns the table's FilterBy tuples (reference fields filtered by another field) matching APredicate.
property IsLarge: Boolean read GetIsLarge;True if the underlying data store is a large one. Set this to True at the view table level to override the setting in the model (for example if the view table is filtered).
TKDataView class
property DatabaseName: string read GetDatabaseName;The database connection name for this view (from the model/config).
function IsAccessGranted(const AMode: string): Boolean;Returns True if access is granted to this view in the given mode.
TKFileReferenceDataType class
Data type for a file-reference field: stores a reference to an external file.
class function GetTypeName: string;Returns the type name under which this data type is registered.
TKHTMLMemoDataType class
Data type for a memo field whose content is HTML (rich text).
class function GetTypeName: string;Returns the type name under which this data type is registered.
