Search This Blog

Showing posts with label HOW DO I Implement the "APEX Submit" Button. Show all posts
Showing posts with label HOW DO I Implement the "APEX Submit" Button. Show all posts

Sunday, July 13, 2025

HOW DO I Implement the "APEX Submit" Button

In Oracle APEX, the "APEX Submit" button is a powerful mechanism used to trigger full-page submission while executing backend PL/SQL processes and validations. Unlike dynamic action buttons that may rely on partial Ajax processing, the APEX Submit button is ideal when your workflow requires full item state synchronization, server-side validation, and database interaction. It's a core feature for form pages, wizards, and processes that store or update data. This blog will show how to properly configure the APEX Submit button and make it a reliable part of your application's logic.How to Implement the APEX Submit Button in Oracle APEX

  1. Add the Submit Button to Your Page

    • Open your page in Page Designer

    • Under the appropriate region, click the + icon and select Button

    • Set the Button Name (e.g., APEX_SUBMIT) and Label (e.g., Submit)

    • Set Action to Submit Page

    • Set Hot to Yes if you want it to appear as the primary action

  2. Configure PL/SQL Process to Run on Submit

    • In the Processing section, add a new Process

    • Choose PL/SQL Code

    • Add the logic, such as:

      INSERT INTO CONTACTS (NAME, EMAIL)
      VALUES (:P1_NAME, :P1_EMAIL);
      
    • Under Server-Side Condition, set:

      • When Button Pressed = APEX_SUBMIT

  3. Add Validations (Optional but Recommended)

    • Under Validations, create validations for required fields

    • Example: “P1_EMAIL is not null”

    • These will execute automatically before the process when using an APEX Submit button

  4. Define a Branch After Submit

    • In Branches, define what happens after the submit

    • Example: Redirect to another page, show a message, or reload the current page

 This button submits the page and sets the session state for the text fields explicitly.

Implementation Steps

  1. Set the Button Action to Defined by Dynamic Action.

  2. Create a Dynamic Action with the following attributes: 

    • Event: Click

    • Action: Execute PL/SQL Code

    • PL/SQL Code:

apex_util.set_session_state('P1_FNAME', :P1_FNAME);

apex_util.set_session_state('P1_LNAME', :P1_LNAME);

  • Affected Elements:

    • Selection Type: Items

    • Items: P1_FNAME, P1_LNAME

This explicitly stores the values in the session state before submitting the page.

Best Practices for APEX Submit Buttons

  • Use clear, distinct button names (SAVE, SUBMIT, NEXT, etc.)

  • Always include validations before data processing

  • Use Server-side Condition: When Button Pressed to control execution logic

  • Use messages to inform users of successful actions or errors

  • Use page branching to guide users after submission

  • Disable the button using a dynamic action if needed to prevent accidental double-submission

Oracle APEX Documentation Links

Conclusion

The APEX Submit button is a fundamental part of Oracle APEX application development, enabling full-page submission along with complete backend interaction. With minimal configuration, you can securely process data, validate user input, and guide users through the application flow. Proper use of APEX Submit ensures a consistent, reliable experience for both developers and users—especially in form-driven pages or any task requiring full PL/SQL processing.

 

How Do I Make a Faceted Search Map Page in Oracle APEX

Combining faceted search with a map region in Oracle APEX enables users to filter data visually and spatially at the same time. This design ...