Tuesday, 25 September 2012

Adding Sql Validation

    In this topic, you add a validation to your tabular form that checks to make sure that a manager is only assigned to one department.
    Under Page Processing, right-click Validating > Validations and select Create.
    Select Tabular Form from the list of Tabular Forms, select the Column validation level and click Next.
    Select the MANAGER_ID column and click Next.
    Enter Manager only assigned to one department for Validation Name and click Next.
    Select SQL for validation type and click Next.
    Select NOT Exists for type of validation and click Next.
    Enter select manager_id from departments for Validation Code, enter something in the Error Message field, select Yes to Always Execute and click Create Validation.
    Your validation was created. Click Run.
    Change the Manager for one of the departments so that it has the same name as another department and click Submit. Notice that Higgins is also the manager for another department so you should get an error.
    The error is displayed. Note the error message includes a clickable link to the corresponding row with the error.

Friday, 21 September 2012

Auding The Tabular Form Validation

                                 In this topic, you add a validation to your tabular form that checks to make sure that a manager is only assigned to one department.
    Under Page Processing, right-click Validating > Validations and select Create.
    Select Tabular Form from the list of Tabular Forms, select the Column validation level and click Next.
    Select the MANAGER_ID column and click Next.
    Enter Manager only assigned to one department for Validation Name and click Next.
    Select SQL for validation type and click Next.
    Select NOT Exists for type of validation and click Next.
    Enter select manager_id from departments for Validation Code, enter something in the Error Message field, select Yes to Always Execute and click Create Validation.
    Your validation was created. Click Run.
    Change the Manager for one of the departments so that it has the same name as another department and click Submit. Notice that Higgins is also the manager for another department so you should get an error.
    The error is displayed. Note the error message includes a clickable link to the corresponding row with the error.

Creating The Tabular Form

                      In this topic, you create a tabular form on the DEPARTMENTS table.
    From the Application page, click Create Page.
    Select Form and click Next.
    Select Tabular Form and click Next.
    Select DEPARTMENTS for Table/View Name. Make sure all the columns are selected and click Next.
    Select Select Primary Key Column(s) for Primary Key Type, select DEPARTMENT_ID for Primary Key Column 1 and click Next.
    Select Existing sequence for Source Type and select DEPARTMENTS_SEQ for Sequence. Then click Next.
    Make sure all the columns are updateable (on the right side) and click Next.
    Change Page Name and Region Title to Update Departments and click Next.
    Select Use an existing tab set and create a new tab within the existing tab set and enter Departments for New Tab Label and click Next.
    Accept the default button labels and branch pages and click Next.
    Click Finish.
    Click Run Page.
    The Tabular form is displayed. You can change the data. Enter something in one of the Cost Center rows and click Submit.
    The row was updated. You can also add a row. Click Add Row.
    Enter a new departments information and click Submit.
    The row was added. Note that the number of rows was incremented by one.You want to change the Manager id column so that it shows the Managers last name. Click the Edit Page button in the Developer Toolbar.
    Under Page Rendering, double-click Update Departments.
    Click the Report Attributes tab.
    Click the Edit icon in front of the MANAGER_ID Column Attribute.
    Change the Column Heading to Manager. You can use the same Shared LOV you created in the previous lab. Select Select List (named LOV) for Display As. Then select the List of Values subtab.
    Select EMPLOYEE_LIST for Named LOV and click Apply Changes.
    Click Run Page.
    Notice the Manager column is now a select list with the last name of the manager. Click the Edit Page button in the Developer Toolbar. In the next topic, you add a tabular form validation.

Importing And Using Plug-In

                                                    Plug-Ins allow for the Application Express framework to be readily extended with custom item types, region types, application processes and Dynamic Actions. Once defined, plug-in based components are created and maintained very much like standard Application Express components. Plug-ins enable developers to create highly customized components to enhance the functionality, appearance and user friendliness of their applications.
                                                   In this topic, you import the slider plug-in and then use it for the Salary page item in your form.
    Click the Shared Components icon in the upper right area of the window..
    Under User Interface, click Plug-ins.
    You want to import the file with the slider plugin. Click Import.
    Click Browse....
    Navigate to the /home/oracle/Desktop/solutions/apexp2_lab directory and select the item_type_plugin_com_oracle_slider.sql file and click Open.
    Click Next.
    Click Next.
    Make sure your Project Tasks Application is selected for Install Into Application and click Install Plug-in.
    The Plug-in was installed successfully. You want to edit your page to use the plug-in. Click the Edit Page 2 icon.
    Double-click the P2_SALARY page item.
    Change Display As to Slider (Plug-in).
    Click the Settings subtab.
    This section is specific to the Slider Plug-in. Set the Maximum Value to 50000 and the Step to 100 and click Apply Changes.
    Click Run.
    Notice that you now see the Slider for the Salary page item. Move the slider to a slightly bigger value. The salary will change as you slide it.
    Click the Application button in the Developer Toolbar. In the next topic, you create a tabular form.