Search code examples
oracle-apexoracle-apex-20.2

Oracle APEX checkbox group, on start up select few items, not all


So I am using a checkbox group to filter my interactive report. I have 4 statuses: active, inactive, in progress and deleted. The filter is working perfectly fine with the code:

 and (instr(':'||:P77_STATUS||':',':'||(vb.status||':')) >0  or :P77_STATUS is null)

Normally when I open the page all rows are loaded with all 4 statuses, however I would like that that the 'deleted'status is not selected initally on loading the page. Is this possible?

Thanks in advance.


Solution

  • First set the P77_STATUS item attribute Source > Maintain Session State to Per Request (Memory Only) if you want to reset the checkbox group on each page refresh, otherwise select Per Session (Disk).

    Next lets say that P77_STATUS LOV attribute is set as SQL query and looks as follow:

    select 'ACTIVE' d, 'ACTIVE' r FROM dual
    union all
    select 'INACTIVE' d, 'INACTIVE' r FROM dual
    union all
    select 'IN PROGRESS' d, 'IN_PROGRESS' r FROM dual
    union all
    select 'DELETED' d, 'DELETED' r FROM dual
    

    Now to check only specific checkboxes set the item attribute Default as:

    • Type: Static
    • Static values: INACTIVE:ACTIVE:IN_PROGRESS