Modify database data
The container details part provides a convenient way to display data, and it provides a working form that enables users to edit and update data in the database.
Formatting a container details part
You can change the format of a container details part in three ways:
•To change the column headings of a container details part, hold down the Alt key and click mouse button 1 on the column heading you want to edit. Then, edit the highlighted text.
•To size the columns in the container details part, select the column and then hold down mouse button 1 to drag one of the selection handles to the left or right.
•Select the column, position the cursor in the column, use mouse button 1 to drag the clumn to its new position.
Applying changes to the database
You can also add push buttons to an application for saving or discarding changes that the user makes to the container details part. For example, add two push buttons, Apply and Cancel, to an application. Then, make the following connections:
1. Connect Apply's clicked event to the apply action of the result table from the multi-row query.
2. Connect Apply's clicked event to the commitTransaction action of the multi-row query.
3. Connect Cancel's clicked event to the cancel action of the result table from the multi-row query.
4. Connect Cancel's clicked event to the rollbackTransaction action of the multi-row query.
After you make the connections in the order shown, select
to test your visual part.
When you change the rows in the container details part and then apply the changes, VA Smalltalk performs all SQL statements needed to update the rows you changed. Similarly, if you use the newRow or deleteRow actions to insert or delete rows, VA Smalltalk performs the insert and delete SQL statements. If you use the cancel action, VA Smalltalk discards the changes you made.
Last modified date: 03/28/2020