Oracle by Example brandingOracle Application Express 18: Customizing an Interactive Grid as a Developer

section 0Before You Begin

This 15-minute tutorial demonstrates you how to edit the region Attributes, report Attributes, and the column Attributes to alter an interactive grid you created in the in the OBE, Oracle Application Express 18: Create Application Wizard.

Background

In this tutorial, you learn how to customize the report layout and change how data displays on the Milestones interactive grid page in the Create Application Wizard app. You update the SQL query so that only incomplete projects are updatable. Then you edit columns by updating the Type attribute. Finally, you hide columns, use options on the Action menu to resize the columns at runtime, change the column sort order, and then save a new Primary report.

What Do You Need?

Accessing Your Development Environment

How you sign in and access Oracle Application Express release 18.1 depends upon where Oracle Application Express resides. Oracle Application Express may reside in a local on-premises Oracle Database or in a hosted environment, such as the Oracle Cloud. The sign in credentials you use to sign in differ depending upon the installation type.

  • Free Workspace: Give Oracle Application Express a test run by signing up for a free workspace. To request an evaluation workspace, go to apex.oracle.com, and click Get Started for Free.
  • Oracle Cloud: Develop and deploy applications without worrying about infrastructure, repair, and downtime. Oracle Application Express is available in Exadata Express Cloud Service and Database Cloud Service. However, you need to manually customize your databases to install and enable Oracle Application Express. To learn more, see Oracle Database Cloud Service.
  • Oracle Application Express On-premises: Install Oracle Application Express directly within any Oracle Database and then sign in to your workspace using your sign in credentials. For details on your sign in credentials, contact your administrator or see Oracle Application Express Installation Guide.
  • Oracle Application Express Pre-Built VM: Install a Pre-Built Virtual Machine (VM) which includes an Oracle Database and Oracle Application Express 18.1. To learn more, see Hands-On Labs.
    Once the VM is installed, start the VM:
    • Click the big red circle labeled Start.
    • Click ODDHands OnLabs.html to start the browser.
    • Click the APEX shortcut, or enter the following URL : http://localhost:8080/ords/f?p=4550:1
    • When prompted to sign in, enter the sign in credentials (unless given other credentials to use):
      • Workspace : obe
      • Username : obe
      • Password : oracle

Note your Application ID may be different when compared to the screenshots in this tutorial. Your Application ID is assigned automatically when you create the application.


section 1Edit the SQL Query

Perform the following steps to edit the SQL Query:

  1. Sign in to your development environment.
  2. From the Workspace home page, click the App Builder icon.
  3. Find the Create App Wizard application.
  4. Note: If you can not find the Create App Wizard application then go through the Oracle By Example listed in the prerequisites to create the application before proceeding.

    Create App Wizard
    Description of the illustration app_wizard.png
  5. Select the Create App Wizard application.
  6. The Application home page appears displaying all pages in the application.

    Create App Wizard Application Page
    Description of the illustration app_wizard_app.png
  7. Click the Milestones page.
  8. The Milestones page appears in Page Designer.

    Milestone page
    Description of the illustration app_wizard_milestone.png
  9. In the Rendering tab, select the Milestones region.
  10. Milestones region
    Description of the illustration sample_milestones_region.png
  11. In the Property Editor, find Source and in SQL Query replace the existing query.
  12. Click the Code Editor icon.
  13. Query Editor icon
    Description of the illustration query_editor_icon.png

    The Code Editor appears.

  14. Replace the query with the following: Click here to copy the query.
    SQL Query
    Description of the illustration sql_query.png

    This new query creates a column to use for a row operation.

  15. Click OK to exit the Code Editor.
  16. Click Save.

section 2Edit the Allowed Row Operation Column Attribute

In this topic, you update the Attribute, Allowed Row Operation Column, and select the column that determines whether the row can be updated.

Perform the following steps to set the Allowed Row Operation Column attribute to OPERATIONS:

  1. In the Rendering tab, select Attributes under Content Body.
  2. attribute window
    Description of the illustration attributes.png

    In the Property Editor, update the following:

  3. Update the Edit attribute:
    • Allowed Row Operations Column - Select OPERATION
    edit attribute window
    Description of the illustration attributes_edit_node.png

section 2Hide the OPERATION Column

Perform the following steps to hide the OPERATIONS column:

  1. In the Rendering Tab under Content Body, expand the Columns node and select the OPERATION column.
  2. operations window
    Description of the illustration operations_node.png
  3. Update the Identification attribute:
    • Type - Select Hidden.
     operation column attribute window
    Description of the illustration operation_column_attribute.png
  4. Click Save.
  5. Click Save and Run page to view your changes.
  6. If a Sign In dialog appears, enter your workspace username and password and click Sign In.
  7. A rendered version of the Milestones page appears.

  8. Click Edit.
  9. Scroll through the report.
  10. milestones report
    Description of the illustration milestones_report.png

    Notice that inactive projects appear slightly grayed out and you can only edit incomplete projects.

  11. Return to Page Designer.

section 2Change the PROJECT_ID Column to a Select List

Perform the following steps to change the PROJECT_ID column to a select list:

  1. In the Rendering Tab under Content Body, expand the Columns node and select the PROJECT_ID column.
  2. Project ID window
    Description of the illustration project_id.png
  3. In the Property Editor, update the following:
    • Identification : Type - Select Select List.
    • Identification : Heading - Change to Project.
    • List of Values : Type - Select Shared Component.
    • List of Values : List of Values - Select SAMPLE$PROJECT_TASKS.PROJECT_ID.LOOKUP.
     project id attributes
    Description of the illustration project_id_column_attributes.png
  4. Click Save.
  5. Click Save and Run page to view your changes.
  6. If a Sign In dialog appears, enter your workspace username and password and click Sign In.
  7. A rendered version of the Milestones page appears.

     milestones report updated
    Description of the illustration milestones_report1.png

    Notice that active projects now display as a select list.

  8. Return to Page Designer.

section 2Update the Name Column

Perform the following steps to change the Name column to a text field and alter the display:

  1. In the Rendering Tab under Content Body, expand the Columns node and select the NAME column .
  2.  name column window
    Description of the illustration name_column.png
  3. In the Property Editor, update the following:
    • Identification : Type - Change to Text Field.
    • Heading : Heading - Change to Milestone.
    • Heading : Alignment- Select Start left alignment .
     name column attributes window
    Description of the illustration name_column_attributes.png
  4. Click Save.
  5. Click Save and Run page to view your changes.
  6.  milestone report name change window
    Description of the illustration milestones_report_2.png

    Notice the Name column has changed to Milestone.


section 2Hide the CREATED, CREATED_BY, UPDATED_BY Columns

You can hide CREATED, CREATED_BY, UPDATED_BY Columns from displaying in an interactive grid by changing the column Type or by using the Hide option on the Actions menu.

To hide columns using the Actions menu:

  1. In the rendered version of the application, select the Actions menu and then Columns.
  2.  hide column action
    Description of the illustration hide_columns.png

    The Columns dialog appears.

  3. Under Displayed, deselect the columns CREATED, CREATED_BY,UPDATED_BY .
  4. columns dialog
    Description of the illustration columns_dialog.png
  5. Click Save.

section 2Change the Columns Using the Mouse

You can resize the columns in an interactive grid by selecting them with your mouse.

To resize the interactive grid columns:

  1. Hover your mouse cursor over the edge of column heading until the cursor changes to resize icon .
  2. Click and hold the mouse.
  3. Move the mouse left and right to achieve the desired width.
  4. Release the mouse.
  5. column resizing cursor
    Description of the illustration column_resizing_cursor.png

section 2Change the Sort Order of Projects and Due Date

You can change the sort order of projects and due date.

  1. To change the sort order of the Projects and Due Date columns:
    • Hover the mouse in the Projects column heading.

    The Sort Ascending and Sort Descending buttons display ascend and descend order .

    ascending descending buttons option
    Description of the illustration ascending_descending.png
    • Click the Sort Ascending button ascending order .
    sort ascending option
    Description of the illustration sort_ascending.png
  2. Sort the Due Date column in ascending order:
  3. Return to Page Designer.

section 2Enable Users to Save a Public Report

Update Attributes to enable users to save a public report. By default, this option is disabled.

Perform the following steps to enable users to save a public report:

  1. In the Rendering Tab under Content Body, select Attributes .
  2.  attributes rendering tab
    Description of the illustration attributes_rendering_tab.png
  3. In the Property Editor:
    • Find Enable Users To .
    • For Save Public Report - Select Yes.
     enable users to attribute
    Description of the illustration enable_users_to_attribute.png
  4. Click Save.

section 2Update the Primary Report

A Primary interactive report displays to all users. Only developers can save Primary reports or add Alternative reports. It is impossible to delete a primary report.

Perform the following steps to save a new primary interactive grid:

  1. Run the page. Click Save and Run Page.
  2. Click the Actions menu.
  3. Select Report and then Save.
  4. The following message displays: Default report saved for all users.


more informationWant to Learn More?