Class

DBKit.RadioGroup

DBKit.RadioGroup


Description

Can display and edit the column value of the current row of the database table to which it has been assigned.

It displays the column value as a group of radio buttons.

The group can populate itself from a database table when the control opens. If AutoPopulateTableName and AutoPopulateColumnName are set, the group fills with a radio button for each value of that column, and the selected value (or its primary key, depending on AutoPopulateStorageType) is stored in the row.

Only the members declared by DBKit.RadioGroup itself are described here; for the inherited members, see the parent class.

Properties

Name

Type

Read-Only

AutoPopulateColumnName

String

AutoPopulateOrderBy

String

AutoPopulateStorageType

StorageTypes

AutoPopulateTableName

String

AutoPopulateWhere

String

ColumnName

String

DefaultRowIndex

Integer

DisplayName

String

InvalidValueMessage

String

Mandatory

Boolean

Methods

Name

Parameters

Returns

TableName

String

Events

Name

Parameters

Returns

Error

error As RuntimeException

String

RowChanged

row As DBKit.Row

RowCreated

row As DBKit.Row

RowDeleted

row As DBKit.Row

RowEditing

row As DBKit.Row

RowLoaded

row As DBKit.Row

RowNotSelected

RowSaved

row As DBKit.Row

RowSaving

row As DBKit.Row

RowUndone

row As DBKit.Row

Enumerations

DBKit.RadioGroup.StorageTypes

StorageTypes

How the selected button value is stored in the database.

Types

ColumnValue

PrimaryKey

ColumnValue stores the selected button's caption in the database column. PrimaryKey stores the primary key of the selected row, which is kept in the button's tag, in the database column.

Property descriptions


DBKit.RadioGroup.AutoPopulateColumnName

AutoPopulateColumnName As String

The name of the database column whose values fill the group when the control populates itself. If blank, ColumnName is used.


DBKit.RadioGroup.AutoPopulateOrderBy

AutoPopulateOrderBy As String

A SQL ORDER BY statement used to sort the values taken from the AutoPopulateTableName table when the group populates itself. The statement is assumed to be valid. If blank, the values are not sorted.


DBKit.RadioGroup.AutoPopulateStorageType

AutoPopulateStorageType As StorageTypes

Whether the group stores the selected button's caption or its primary key in the database column.


DBKit.RadioGroup.AutoPopulateTableName

AutoPopulateTableName As String

The name of the database table the group populates itself from when the control opens. If blank, the control's table is used.

When the group populates itself, the buttons already in the group are replaced by the values from the database. With ColumnValue storage, each value appears once and blank values are not included.


DBKit.RadioGroup.AutoPopulateWhere

AutoPopulateWhere As String

A SQL WHERE clause used to filter the values taken from the AutoPopulateTableName table when the group populates itself. The clause is assumed to be valid. If blank, the values are not filtered.


DBKit.RadioGroup.ColumnName

ColumnName As String

The name of the database column whose value this control displays and edits.

If blank, the control's name is used as the column name. The name may be qualified with a table name (for example "tablename.columnname") when the control shows a column from a related table.


DBKit.RadioGroup.DefaultRowIndex

DefaultRowIndex As Integer

The index of the button that is selected when a new row is created.


DBKit.RadioGroup.DisplayName

DisplayName As String

A user-friendly name for the control, shown to the user in place of the column name (for example in the InvalidValueMessage).


DBKit.RadioGroup.InvalidValueMessage

InvalidValueMessage As String

The message displayed when the control is mandatory but has no selection. Use <$1> as a placeholder for the control's display name.

The default is "<$1> must have a button selected."


DBKit.RadioGroup.Mandatory

Mandatory As Boolean

If True, the user must select a button before the row can be saved. When a row with no selection in a mandatory control is saved, the InvalidValueMessage is displayed and the save is cancelled.

Method descriptions


DBKit.RadioGroup.TableName

TableName() As String

Returns the name of the database table the control's column belongs to. If the ColumnName is qualified with a table name (for example "tablename.columnname"), that table name is returned; otherwise the table is resolved from the control's layout.

Event descriptions


DBKit.RadioGroup.Error

Error(error As RuntimeException) As String

An error occurred in the control. The exception passed to this event is a DatabaseException when the control could not populate itself from the database, or an InvalidArgumentException when the current row's value could not be found in the group.

Return the message to display, or return an empty string to display no message at all. If you do not implement this event, no message is displayed.


DBKit.RadioGroup.RowChanged

RowChanged(row As DBKit.Row)

The current row (passed to the event) has been changed.


DBKit.RadioGroup.RowCreated

RowCreated(row As DBKit.Row)

A new row (passed to the event) was just created and is now the current row.


DBKit.RadioGroup.RowDeleted

RowDeleted(row As DBKit.Row)

The current row (passed to the event) has been deleted.


DBKit.RadioGroup.RowEditing

RowEditing(row As DBKit.Row)

The current row (passed to the event) is being edited by the user.


DBKit.RadioGroup.RowLoaded

RowLoaded(row As DBKit.Row)

The current row (passed to the event) has been loaded.


DBKit.RadioGroup.RowNotSelected

RowNotSelected

There is no row currently selected.


DBKit.RadioGroup.RowSaved

RowSaved(row As DBKit.Row)

The current row (passed to the event) has been saved.


DBKit.RadioGroup.RowSaving

RowSaving(row As DBKit.Row)

The current row (passed to this event) is about to be saved.


DBKit.RadioGroup.RowUndone

RowUndone(row As DBKit.Row)

The changes made to the current row (passed to this event) have been undone.

Notes

Localize the control's user-facing text (InvalidValueMessage) 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

Desktop

Operating Systems

All

See also

DesktopRadioGroup parent class; DBKit.Row class.