Class
DBKit.Page
DBKit.Page
Description
Used to display other DBKit controls with data from the current row of a database table to which it's assigned.
Only the members declared by DBKit.Page itself are described here; for the inherited members, see the parent class.
Properties
Name |
Type |
Read-Only |
|---|---|---|
Methods
Name |
Parameters |
Returns |
|---|---|---|
theRowsSource As |
||
|
||
parentTableName As String |
||
Events
Name |
Parameters |
Returns |
|---|---|---|
error As RuntimeException |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
||
row As DBKit.Row |
Property descriptions
DBKit.Page.AutomaticHints
AutomaticHints As Boolean
Whether the controls on this page automatically set their Hint from the database column's display name when no Hint is set.
The default is True.
DBKit.Page.ConfirmCancelButtonCaption
ConfirmCancelButtonCaption As String
The caption of the Cancel button in the unsaved-changes confirmation dialog.
The default is "Cancel".
DBKit.Page.ConfirmContinueButtonCaption
ConfirmContinueButtonCaption As String
The caption of the Continue button in the unsaved-changes confirmation dialog.
The default is "Continue".
DBKit.Page.CurrentRow
CurrentRow As DBKit.Row
The current row of the database table this page operates on.
DBKit.Page.Database
Database As Database
The database this page operates on.
DBKit.Page.DeleteConfirmExplanation
DeleteConfirmExplanation As String
The explanation text of the delete confirmation dialog.
The default is "This action cannot be undone."
DBKit.Page.DeleteConfirmMessage
DeleteConfirmMessage As String
The message text of the delete confirmation dialog.
The default is "Are you sure you want to delete this record?".
DBKit.Page.DeleteConfirmTitle
DeleteConfirmTitle As String
The title of the delete confirmation dialog.
The default is "Delete Record".
DBKit.Page.OrderBy
OrderBy As String
The sort order used when loading rows from the database table.
DBKit.Page.SelectedRowIndex
SelectedRowIndex As Integer
The index of the currently selected row in the list control.
DBKit.Page.TableName
TableName As String
The name of the database table this page operates on.
DBKit.Page.TableRelationships
TableRelationships As String
The relationships between this page's table and other tables, with one relationship per line in the format childTableName.childColumnName = parentTableName.parentColumnName. Appending = viaColumnName is optional and specifies the via column, which identifies which relationship to use when the child table has more than one foreign key to the same parent table.
The child column is the foreign key and the parent column is the primary key it refers to. The relationships are loaded when the page opens and are used to find related rows.
DBKit.Page.UnsavedChangesExplanation
UnsavedChangesExplanation As String
The explanation text of the unsaved-changes confirmation dialog.
The default is "If you continue, your changes will not be saved.".
DBKit.Page.UnsavedChangesMessage
UnsavedChangesMessage As String
The message text of the unsaved-changes confirmation dialog.
The default is "You have unsaved changes.".
DBKit.Page.UnsavedChangesTitle
UnsavedChangesTitle As String
The title of the unsaved-changes confirmation dialog.
The default is "Unsaved Changes".
DBKit.Page.Where
Where As String
The filter used when loading rows from the database table.
Method descriptions
DBKit.Page.Constructor
Constructor(theRowsSource As DBKit.SDK.RowsListControl, createNewRow As Boolean)
Called when the page is created. Sets up the page's layout and optionally creates a new row. theRowsSource is the rows list control the page is associated with; pass Nil for none. createNewRow is True to create a new row when the page opens.
DBKit.Page.DBKitControls
DBKitControls() As DBKit.SDK.RowBase()
Returns the DBKit controls on this page.
DBKit.Page.ForeignKeyColumnName
ForeignKeyColumnName(parentTableName As String) As String
Returns the name of the foreign key column in this page's table that relates to the table parentTableName.
DBKit.Page.TableName
TableName() As String
Returns the name of the database table for this page: the TableName property if set, otherwise the page's name.
Event descriptions
DBKit.Page.Error
Error(error As RuntimeException)
The error passed to this event has occurred.
DBKit.Page.RowChanged
RowChanged(row As DBKit.Row)
The current row (passed to the event) has been changed.
DBKit.Page.RowCreated
RowCreated(row As DBKit.Row)
A new row (passed to the event) was just created and is now the current row.
DBKit.Page.RowDeleted
RowDeleted(row As DBKit.Row)
The current row (passed to the event) has been deleted.
DBKit.Page.RowEditing
RowEditing(row As DBKit.Row)
The current row (passed to the event) is being edited by the user.
DBKit.Page.RowLoaded
RowLoaded(row As DBKit.Row)
The current row (passed to the event) has been loaded.
DBKit.Page.RowNotSelected
RowNotSelected
There is no row currently selected.
DBKit.Page.RowSaved
RowSaved(row As DBKit.Row)
The current row (passed to the event) has been saved.
DBKit.Page.RowSaving
RowSaving(row As DBKit.Row)
The current row (passed to this event) is about to be saved.
DBKit.Page.RowUndone
RowUndone(row As DBKit.Row)
The changes made to the current row (passed to this event) have been undone.
Notes
Connecting the layout to a database
Add a DatabaseConnection object to your project and assign it to the Database property in the Layout Editor. That is how the layout knows which database connection to use.
How controls find their columns
If a control's ColumnName is blank, the control's own name is used as the column name. You only need to set ColumnName if you want a different column or cannot name the control the same as the column.
Filtering and sorting rows
Use Where to filter which rows are loaded and OrderBy to sort them. Provide just the expression in each case, not the SQL keywords: set Where to Country = 'USA' rather than WHERE Country = 'USA', and OrderBy to LastName rather than ORDER BY LastName.
Localization
Localize the layout's user-facing text (the delete-confirmation and unsaved-changes dialog text and the confirmation button captions) the standard Xojo way: assign a dynamic constant to each property and provide translations for as many languages as you need, or localize the property values directly.
Compatibility
Project Types |
Web |
Operating Systems |
All |