To make the list editable is the next goal. To edit the details of a department, you will select the department in the list and modify its data in text fields.
Do the following:
The variable will contain the object that represents the selected department as individual departments from the list are selected. By connecting the attributes of the department to some edit controls we can modify the details for a selected department.
If we were to do these steps an exception would be raised by the shared transaction stating that we attempted to write into a read-only version. This is because persisted objects cannot be modified unless a transaction has been started.
ObjectExtender has some visual parts to help you work with transactions. In the Composition Editor, the parts palette has a category named | department | Transaction begin. department := TstDepartmentHome singleton findByDepartment: 'Math'. department markRemoved. Transaction current commit. . The first ObjectExtender part to illustrate is the TopLevelTransaction part. This part will always begin a new top-level transaction when the view on which it is used is opened.
Do the following:
Note that the changes were lost. This is because the transaction was not committed.
This time the changes are committed to the shared transaction and made persistent.
Open it again and note that the changes were lost. This is because the transaction was not committed. Make some changes again and click Save. This time the changes are committed to the shared transaction and made persistent.