Download presentation
Presentation is loading. Please wait.
Published byChloe Baker Modified over 9 years ago
1
Stacked Canvas A content canvas is a main from canvas while a stacked canvas is a secondary canvas that overlays or partially covers a content canvas. In other words, it can be stacked on another canvas. Thus in this slide presentation a content canvas will be made first, followed by a stacked canvas.
2
Open a new Form Module
3
Create a new data block using the EMPLOYEE table
4
Use a new Content canvas
5
Set these prompts
6
The layout style should be Form
7
Display only on record and title the frame Employee Details
8
The Employee Details frame
9
Open the Property Palette for EMPLOYEE NUMBER
10
Change the required property to No
11
Highlight the Module and create a new data block for the EMPLOYEETYPE table
13
Deselect Auto-join. This data block should not be related to EMPLOYEE
14
Place this data block on a new stacked canvas
15
Use these prompts
16
Select the Form layout
17
Only display one record Use the Frame Title, Employee Type Details
18
The canvas for Employee Type Details In the Layout Editor, resize this stacked canvas to the Following: Height 75 Width 410
19
The canvas has been resized
20
Notice the size of the canvas
21
Change the name of the Content Canvas to EMPLOYEES Change the name of the Stacked Canvas to EMPLOYEE_TYPE Name changes can be done in the Property Palette or on the Object Navigator. In using the Object Navigator, highlight the object to be changed. Ensure that the highlight is blue, not yellow, and change the name.
22
The names have been changed
23
Highlight the form window, WINDOW1. Open the Property Palette and set these properties: Name: PRINCIPAL_WINDOW Title: EMPLOYEE CHANGE FORM Primary Canvas: EMPLOYEES
24
Properties changed
25
The window is now called PRINCIPAL_WINDOW
26
Highlight Windows and create a new window by clicking Edit, Create
27
The new window, WINDOW11 has been created. Open the Property Palette and set these properties: Name: EMPLOYEE_TYPE Title: ADD NEW TYPE Primary Canvas: EMPLOYEE_TYPE
28
Properties changed
29
For the EMPLOYEE_TYPE window, set these additional properties: X Position: 20 Y Position: 50 Width: 410 Height :75
30
Properties changed
31
Open the Property Palette for the EMPLOYEE_TYPE canvas Change the window to EMPLOYEE_TYPE
32
Locate the EMPLOYEETYPE item in the EMPLOYEE data block and create a When-Validate-Item trigger
33
Enter this source code for the trigger For the explanation of %ROWTYPE see the next slide
34
%ROWTYPE Attribute The %ROWTYPE attribute provides a record type that represents a row in a database table. The record can store an entire row of data selected from the table or fetched from a cursor or cursor variable. Variables declared using &ROWTYPE are treated like those declared using a datatype name. %ROWTYPE can include all the columns in a table: emp_rec employee%ROWTYPE; Or a subset of the columns, based on a cursor: CURSOR XYZ IS SELECT DepartmentNumber, DepartmentName FROM departments; Dept_rec XYZ%ROWTYPE; Columns in such rows have the same names and datatypes, but do not inherit constraints such as NOT NULL or default values.
35
Open the Layout Editor for EMPLOYEE Add a button next to Emp. Type
36
Push Button has been added. Open the property Palette and give it the following properties: Name: ADD_TYPE Label: ADD TYPE
37
Properties changed
38
Name changed
39
Create a When-Button-Pressed trigger for the ADD_TYPE item. With Triggers highlighted, click Edit, Create
40
Enter this code Go_block navigates to the indicated data block. If the target block is non-enterable, an error occurs. The syntax: Go-block (‘Block Name’);
41
Open the Property Palette for the data block EMPLOYEETYPE. Set the following properties: Update Allowed: No Delete Allowed: No Query Allowed: No
42
1. Compile and run the form. Enter Ctrl-F11 to enter data on the form. You must be connected to the database! 2. Enter an invalid Emp. Type 3. This warning is given
43
Change the Emp. Type back to its original value and click the ADD TYPE button
44
The stacked canvas, ‘Employee Type Details’ appears on the top of the content canvas, ‘Employee Details’. Notice that there are two windows: 1.EMPLOYEE CHANGE FORM 2.ADD NEW TYPE The ADD NEW TYPE window is the active window.
45
1. Enter a new Emp. Type as shown 2. Click Insert record 3. Click Save 4. A new record will have been added to the database
46
A new record has been added to EMPLOYEETYPE
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.