TyBase is all about simplifying data management. Whether it’s at home, in a small business environment, or in enterprise- people always have the need to collate, process, and format information. A traditional database system is often expensive and technically challenging to deploy- meaning that we often fall back to unsuitable techniques such as spreadsheets or text editors when we really need something a little more structured. TyBase provides that ‘something’.
Forms
A “Form” presents a formatted view of a single row of a table. This allows the database author to expand the data out into a user-friendly layout, but also provides expanded information that is not possible in a single-row format such as showing related rows from other tables.
Editing a form takes place in a simple drag-and-drop style, with popup options to control sourcing of data and automatic layout functions. No programming knowledge is required to create a form.
Since a form is a layout rather than a data source, multiple forms can be created to reflect different views of the same data. This can be used to create variants for different tasks, or to create a print-friendly layout for customers which hides any in-house information and options.
Creating a Form
To create an entirely new form, follow these steps. It is assumed that you have already created a database with at least one table, and that your table has one or more columns:
- Go to your database’s “Tables List” window, using “Open Database Tables List” from the “Authoring” menu. (Multiple such windows can be open simultaneously. This is a cosmetic issue and will not cause problems, though it may cause user confusion.)
- Right click on the table for which you wish to create the new form, and select “Edit Table”.
- In the “Table” edit window, switch to the “Forms” tab.
- Click the
button to add a new form.
- Click on the new form’s name (initially “Untitled Form”) and edit the name to something meaningful to you.
- Double click on the new form (outside of the name edit text) to open the form editor.
- You will now see a blank “Editing Form” window.
At this point you have created a new, empty form. The form is not useful in this state, so your next step should be to add some form elements:
- Hold down the “command” key while dragging out a rectangular placement area for your first element.
- Once the element is created, double click within the element to modify the element’s properties.
- Edit the “Name” and “Type” fields as appropriate. Many of the types are self-obvious, but a full list with descriptions is available later on this page.
- If the column is intended to reflect data from the table, edit the “Data Column” fields as appropriate. You can use the drop-down menu to the right of this field to select one of the available columns, or you can type the field name or a calculation.
- This is enough to get started. Close the element properties window and continue creating elements.
- A detailed explanation of each form element type, including an explanation of the remaining property fields, can be found below.
Setting a Table’s Default Form
A table’s “default form” is displayed whenever the database user double-clicks on any row in that table’s row list window. Since you can create multiple forms for a single table, it is important that you can specify which of these forms should be displayed by default. This is controlled in the “Edit Table” window. These instructions assume that you have already created a form for your table:
- Go to your database’s “Tables List” window, using “Open Database Tables List” from the “Authoring” menu.
- Right click on the table for which you wish to create the new form, and select “Edit Table”.
- In the “Table” edit window, switch to the “Forms” tab.
- At the bottom of the tab is a popup for “Default Form”. Set this to your preferred layout for the table data.
The default form is also displayed automatically when creating a new row in the table’s row list window by clicking the button.
Opening Data in a Form
The Default Form (see above) is opened when the user double-clicks any row in your table’s row list window. It is also possible for the database user to open the data in any of the non-default forms:
- Go to your database’s “Tables List” window, using “Open Database Tables List” from the “Authoring” menu.
- Double click on any table to open its row list window. For this example, select a table which has multiple forms defined.
- Right click on any existing row in the table, and select the desired form from the “View In Form >” submenu.
Layout Controls
While editing the form, the following controls are available:
- Hold down the “command” key while dragging out a placement rectangle, in order to create a new element in the form.
- Left click on any form element to select it. Selected elements have a blue highlight frame and show corner anchors.
- Left click in any blank area to deselect all controls.
- Hold down shift while left clicking to use multiple selection.
- Left click on a form element and drag to reposition it.
- While a form element is selected, corner anchors will be displayed. Left click and drag these to resize the element.
- While a form element is selected, use the ‘delete’ key to delete it.
- Command-Z and Command-Shift-Z can be used to undo and redo edits, respectively.
- Cut/Copy/Paste (and other “Edit” menu commands) operate as expected.
- Pressing or holding the arrow keys will nudge the selected form elements. This is useful for precise placement.
- Hold down the “option” key while dragging a form element to create a clone of that element.
- Double click on any form element to edit its properties.
Both the “Editing Form” window and the actual form window accessed by database users are resizable. Drag the window edges or corners to resize the window to your preferred size. By default, form elements will attach to the top-left corner of the window and will not resize. This behaviour can be adjusted in each element’s properties window using the “Horizontal:” and “Vertical:” popups.
Notes for advanced users:
- If you drag an element over a pane splitter, it will become a child of that pane splitter. If you drag the element back out of the pane splitter, it will cease to be a child of the pane splitter.
- When overlapped form elements are not selected, the frontmost form element will respond to a click. When one of the overlapped elements is already selected, it will take priority over the other elements at that location.
Element Types
Numerous element types are available. While they all share some basic properties, each has its own specific properties and purpose.
System Button
A button with a title. Clicking the button triggers a specified action.
Action – Specifies the action to take when the button is clicked. The following choices are available:
- None – no action is taken.
- Save and Close – the form is finalised and closed. The button is also rendered with the “default button” highlighting, and responds to the “return” key.
- Cancel – the form changes are reverted, and the form is closed. The button responds to the “escape” key.
- Save and Next – the form is finalised, and editing proceeds to the next row of the parent table. Leaving the last row of the table returns the user to the first row.
- Save and Prev – the form is finalised, and editing proceeds to the previous row of the parent table. Leaving the first row of the table returns the user to the last row.
- Open Reference – opes the specified reference in a new form browser.
- View Table – opens the specified table in a new table browser.
Text Style – Adjusts the text style for the button’s title.
Name – Specifies the button’s title text.
Icon Button
An icon button with optional title and optional icon. Clicking the button triggers a specified action. The ‘Frame’ tab can be used to adjust the overall style of the button.
Action – Specifies the action to take when the button is clicked. The following choices are available:
- None – no action is taken.
- Save and Close – the form is finalised and closed. The button responds to the “return” key.
- Cancel – the form changes are reverted, and the form is closed. The button responds to the “escape” key.
- Save and Next – the form is finalised, and editing proceeds to the next row of the parent table. Leaving the last row of the table returns the user to the first row.
- Save and Prev – the form is finalised, and editing proceeds to the previous row of the parent table. Leaving the first row of the table returns the user to the last row.
- Open Reference – opes the specified reference in a new form browser.
- View Table – opens the specified table in a new table browser.
Text Style – Adjusts the text style for the button’s title.
Name – Specifies the button’s title text.
Icon Index – Specifies an icon to display on the button. Icons indices start at 0 and are increase consecutively.
Checkbox
A checkbox with a title. This should be bound to a boolean value.
Text Style – Adjusts the text style for the checkbox title.
Name – Specifies the checkbox title text.
Data Column – Specifies a column name or expression which is bound to the checkbox value.
Static Text
A non-editable text string which can be a literal or can be bound to a value.
Text Style – Adjusts the text style for the text.
Data Column – Specifies a calculation (including column name, literal string, etc.) whose value is displayed.
Name – While authoring the form, the name is displayed in place of actual data.
Editable Text
An editable text field which should be bound to a text or integer value.
Text Style – Adjusts the text style.
Data Column – Specifies a column name or expression which is bound to the editable text field’s value.
Date Picker
An editable date field which should be bound to a date value.
Text Style – Adjusts the text style.
Data Column – Specifies a column name or expression which is bound to the editable text field’s value.
Table
A powerful view of a specified table with various configuration options. As with other table views, the user may add new rows manipulate field data, move and sort columns, etc.
Table – Specifies the table which is to be displayed. This “table” element displays the specified table with the same user interface as the table’s row list window, although user customisations such as column widths, column visibility, sort order, etc. are specific to this form element and do not affect the table’s row list or other form elements which display the same table.
Filter Script – (optional) A condition which is evaluated per row to determine whether the row should be displayed in the table view. This may be used to attach ‘search’ elements (see below) or perform other custom filtering.
Form Column – (optional) The column of the displayed table which must equal this form’s data column. Non-matching rows are not displayed. The column must be a reference column which references this form’s table. This column is also hidden from the table view.
Data Column – (optional) Select a reference column within this form’s parent table in order to change the behaviour of the “Form Column” (see above) to filtering on the referenced row rather than filtering on the form’s parent row.
Form – (optional) The form to display when a row is double-clicked.
New Row Form – (optional) The form to display when a new row is added.
Row Picker
A popup menu which allows selecting a row from a specified table. Should be bound to a reference variable.
Table – Specifies the table from which the row is to be picked. This must match the ‘data’ property.
Data Column – Specifies a column name or expression which is bound to the row picker’s value. This must specify a reference column and the reference’s table must match the ‘table’ property.
Sort Column – Specifies the row of the target table which is used to sort the rows in the picker.
Filter Script – (optional) A condition which is evaluated per row to determine whether the row should be displayed in the picker.
Summary Column – The column of the target table whose value should be displayed in the picker.
Splitter
A non-data element which divides the form into separate “panes”, which can be resized by the database user. Other elements may be added into the splitter panes (rather than to the top level of the form) by dragging the child element and releasing the mouse while over the splitter pane.
Image
A non-data element. Typically created by pasting an image from some outside source such as a graphics viewer.
Divider
A non-data element. Provides a familiar visual division or frame appearance, but does not offer any actual functionality.
Search Text
A search entry field, typically attached to a table element to allow the database user to filter the display. A non-data element.
Name – Used to identify this search field for filtering purposes.
The search functionality is not automatic. Row Pickers must use an appropriate condition to implement the search, such as:
searchstring(columnName, form.searchFieldName.value)
This works through the use of the special ‘form’ keyword, which allows reading values from the form directly (as opposed to from the database proper.) This can only be used within form calculations.
The ‘searchstring’ function offers the typical human text search facility, which is typically what you want for a search field, however you can alternative opt for custom filtering logic.
Custom Actions
In addition to the built-in actions, it is possible to script a custom action for a button. The image below shows a “help” icon button which links to a web page. This is used in the Accounting template.