TheSchmidly
TheSchmidly

Reputation: 59

How can I implement a select list in apex oracle's interactive grid using only sql and what's available in oracle APEX?

ID Material Material_Num User Assign User
1 stick 1111 Billy Bob "select list of users"
2 stone 1112 Jane Doe "select list of users"
3 rock 1113 John Deer "select list of users"
4 slab 1114 "select list of users"
5 brick 1115 "select list of users"

There will be a save button which will update the user column with the value in the assign user column. If the select list can be consolidated under the user column and keep the updated values that would be even better.

These are the steps I have taken so far:

  1. Added an interactive grid to the page.
  2. Created a query to populate the interactive grid.
SELECT DISTINCT
       MD.ID,
       MD.MATERIAL,
       MD.MATERIAL_NUMBER,
       FIRST_NAME || ' ' || LAST_NAME USER,
       USER AS DISPLAY_VALUE
  FROM MATERIAL_DATA MD
 INNER JOIN MATERIAL_OWNER_DATA MOD
       ON MD.USER = MOD.OWNER
  1. Added a process called "save interactive grid data" to make the grid editable
  2. Added an assign user column to the interactive grid.
  3. Made the assign_user column editable and changed it to a select list.
SELECT
    T1.DISPLAY_VALUE as DISPLAY_VALUE
FROM (
        ( SELECT
            TM.FIRST_NAME || ' ' || TM.LAST_NAME as DISPLAY_VALUE,
            upper(TM.NUMBER) as RETURN_VALUE,
            1 as ORD
        FROM 
            TEAM_MEMBERS TM
        WHERE
            TM.NUMBER IS NOT NULL
            AND TM.BOOL = 'Y'
        )
        UNION ALL
        ( SELECT
            'Not Required' as DISPLAY_VALUE,
            'Not Required' as RETURN_VALUE,
            0 as ORD
        FROM DUAL
        )
    ORDER BY 3, 1
) T1

  1. Added the assign_user column to my interactive grid's select statement.

So far as I have searched I have not seen a step-by-step way to add the select list to the grid. It's possible I've oversimplified my process but this is the best way I could describe it. If answering this is too cumbersome a link to a good source would also be appreciated.

My company won't allow the use of css or javascript so this has to be done strictly with sql and what's already available in apex_oracle.

Upvotes: 0

Views: 2321

Answers (1)

Littlefoot
Littlefoot

Reputation: 142705

The 2nd query you posted should be

SELECT t1.display_value, t1.return_value FROM (...) t1 

(at least, looks like to me).

Upvotes: 0

Related Questions