In these steps, you create the insert.jsp page, which enables users to enter details of a new employee record.
Create a new JSP page and call it insert.jsp.
Give the page the same heading as before, AnyCo Corporation: HR Application, and format it as Heading 2, and center it.
On the next line enter Insert Employee Record, and apply the Heading 3 format. Align this heading to the left of the page.
Add the JDeveloper stylesheet to the page.
Add a Form. In the Insert Form dialog box, enter insert_action.jsp for the Action property, and click OK.
Add a Table inside the Form. Specify that you want 6 rows and 2 columns and accept all other layout defaults.
In the first column, enter the following headings, each on a separate row: First Name, Last Name, Email, Phone, Job, Monthly Salary.
Drag and drop a Text Field into the column to the right of the First Name header. In the Insert Field dialog box, type first_name in the Name property.
Drag a Text Field next to each of the Last Name, Email, Phone, and Monthly Salary headers. Specify the values for each of these text fields for the Name property in the Insert Field dialog box. The values are indicated in the following table:
Text Field For
Set the Name Property To
Last Name
last_name
Email
email
Phone
phone_number
Monthly Salary
salary
This procedure is different for the Job row.
Drag a Combo Box component from the HTML Forms page of the Component Palette to the column next to the Job heading.
In the Insert Select dialog box, enter job_id as the name, and 1 as the size. Click the add (+) icon and enter SA_REP in the Value field, and in the Caption field, enter Sales Representative. Click the add(+) sign to add each of the following job titles, then click OK.
Value
Caption
HR_REP
HR Representative
PR_REP
PR Representative
MK_MAN
Marketing Manager
SA_MAN
Sales Manager
FI_MAN
Finance Manager
IT_PROG
Software Developer
AD_VIP
Vice President
Drag a Submit button to the Form below the table. In the Insert Submit Button dialog box, enter Add Employee for the Value property.
Save your work.
Figure 5-6 shows the insert.jsp page in the Visual Editor.