Search This Blog

Saturday, July 12, 2025

How do I Move data from left panel to right panel

Introduction
In Oracle APEX, creating a user interface that allows users to move data from a left panel to a right panel—commonly known as a dual list or shuttle component—is a practical way to handle multi-selection and assignment tasks. Whether you're building a form to assign roles to users or selecting multiple items from a list, implementing this feature improves usability and keeps the page clean and interactive. Oracle APEX provides built-in components and dynamic actions to make this functionality simple to implement.

 How to Move Data from Left Panel to Right Panel in Oracle APEX

To create a dual-panel interface where users can move data from the left list to the right:

  1. Create a Shuttle Item

    • Go to your APEX Page Designer.

    • Add a new Item to the page.

    • Set the Type to Shuttle.

    • Under the List of Values section, define a LOV Query that retrieves values for the left panel.

      SELECT ROLE_NAME d, ROLE_ID r FROM APP_ROLES ORDER BY ROLE_NAME
      
    • This query should return the display label (d) and return value (r).

  2. Define Save Logic

    • The shuttle item stores the selected values (those in the right panel) as a colon-separated string.

    • To process these values in PL/SQL (e.g., to insert into a table), use a loop:

      FOR i IN 1 .. apex_util.string_to_table(:P1_SHUTTLE_ITEM).COUNT LOOP
        INSERT INTO USER_ROLES (USER_ID, ROLE_ID)
        VALUES (:P1_USER_ID, apex_util.string_to_table(:P1_SHUTTLE_ITEM)(i));
      END LOOP;
      
  3. Optional: Filter the Left Panel Values

    • If you want to exclude values already selected or assigned, modify your LOV query to filter out those already in the right panel.

  4. Customize with Dynamic Actions (Optional)

    • Add Dynamic Actions to refresh the shuttle or handle additional logic when selections change.

    • You can also use apex_item.select_list_from_query_xxx functions in classic reports if you prefer building a fully custom interface.

  5. Styling and Usability

    • Shuttle items support template options, so you can change width, label positioning, and spacing.

    • Add instructions above the shuttle so users understand how to interact with it.

       

 Select Master Detail

A screenshot of a computer

AI-generated content may be incorrect.

Select the table

A screenshot of a computer

AI-generated content may be incorrect.

Select the kind of report

A screenshot of a computer

AI-generated content may be incorrect.


Name the page

A screenshot of a computer

AI-generated content may be incorrect.

Identify the table that you want to work with

A screenshot of a computer

AI-generated content may be incorrect.

This is the result:

A screenshot of a calendar

AI-generated content may be incorrect.

Conclusion
Moving data from a left panel to a right panel in Oracle APEX is a powerful way to handle multiple selections in a clean, user-friendly format. The shuttle item simplifies this process, allowing developers to implement it with minimal code while still supporting flexible logic and customization. With proper LOVs and PL/SQL handling, this component makes it easy to manage assignments, roles, and any other selection-based tasks in your APEX applications.


No comments:

Post a Comment

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 ...