2

I have a badge list plug in returning a few items:

SQL for the badgel list plug-in is below:

WITH

STUDY_MV AS 
(

    SELECT /* MATERIALIZE */
    * FROM VW_GRET_CTA_STUDIES  
    WHERE GRET_ID = :P14_GRET_ID
    AND STUDY_CODE = :P14_STUDY_CODE   
    AND VARIATION_REQUEST_ID IS NULL
    AND APPLICATION_TYPE = 'Clinical Trial Application'
)
select
    '1) Despatched CTA' as label,
    (SELECT COUNT(DISTINCT REGISTRATION_UID) FROM STUDY_MV 
         WHERE 
        STUDY_STATUS = 'Despatched'
    ) as value,  
    'Despatched' AS STUDY_STATUS,

    APEX_PAGE.GET_URL (
            p_page   => 15,
            p_items  => 'P15_GRET_ID,P15_PREVIOUS_PAGE,P15_STUDY_CODE,P15_STUDY_STATUS',
            p_values => :P14_GRET_ID || ',14,' || :P14_STUDY_CODE || ',Despatched')  as url
from dual
UNION
select
    '2) Submitted CTA' as label,
    (SELECT COUNT(DISTINCT REGISTRATION_UID) FROM STUDY_MV 

         WHERE 
        STUDY_STATUS = 'Submitted'
    ) as value,  
    'Submitted' AS STUDY_STATUS,

    APEX_PAGE.GET_URL (
            p_page   => 15,
            p_items  => 'P15_GRET_ID,P15_PREVIOUS_PAGE,P15_STUDY_CODE,P15_STUDY_STATUS',
            p_values => :P14_GRET_ID || ',14,' || :P14_STUDY_CODE || ',Submitted')  as url
from dual

This works...

I was originally using the URL to go to another page (page 15), and was passing parameters to it...but I now need to do a refresh (ajax/dynamic action) of another region on the same page based on the selection in the badge list. i.e. if they click the "Submitted" bage, then an interactive grid on the same page gets refreshed over ajax to only show "Submitted" records).

The interactive grid has the following SQL:

SELECT
    DISTINCT
    reg_flag_passive,
    study_status,
    registration_uid,
    application_stage,
    application_type,
    lu_withdrawn_dt,
    country_display_label,
    authorization_status,
    registration_name_details,
    registration_number,
    reg_remarks,
    region,
    preferred_trade_name,
    lu_despatched_dt, 
    LU_SUBMITTED_DT,
    lu_resubmitted_dt,
    lu_approved_dt,
    lu_non_submission_approval_dt,
    lu_approved_inc_non_sub_year,
    lu_approved_inc_non_sub_dt,
    lu_cancelled_dt,
    lu_report_due_dt,
    lu_rejected_dt,
    lu_planned_submission_dt, 
    LU_EXPECTED_APPROVAL_DT,
    cta_ind_no,
    study_code,
    gret_id
FROM
    vw_gret_cta_studies WHERE STUDY_CODE = :P14_STUDY_CODE AND GRET_ID = :P14_GRET_ID
    AND VARIATION_REQUEST_ID IS NULL
    AND APPLICATION_TYPE = 'Clinical Trial Application'
    AND 
    1 = (CASE WHEN :P14_STUDY_STATUS IS NULL THEN 1 ELSE CASE WHEN STUDY_STATUS = :P14_STUDY_STATUS THEN 1 ELSE 0 END END)

What I need to do is POPULATE the :P14_STUDY_STATUS page item, to session, with the selected STUDY_STATUS value clicked within the badge-list plug in, and then perform a refresh of the interactive grid region - which will pick up the :P14_STUDY_STATUS value in the query.

I am guessing that in order to write things into session via javascript, and then refresh a region (e.g. call a dynamic action to do it) - then I need to perhaps modify the URL I am generating in the badge list SQL to make a javascript call? But having no luck at all.

smackenzie
  • 2,880
  • 7
  • 46
  • 99
  • 1
    I managed to fix it using a custom event dynamic action, and adding a javascript call in the URL parameter of the badge list. – smackenzie Sep 21 '19 at 12:23

0 Answers0