4 Replies Latest reply: Dec 13, 2012 4:34 AM by Gus C RSS

    Refesh Region

    Gus C
      I have a page with a create collection in On Load Process.
      I have 3 select lists which are parameters for creating the collection.
      List 1
      List 2 - child of List 1
      List3 - child of List2

      I also have a report region, which is a report based on the collection.

      When ever I change my lists (collection parameters), the collection refreshes correctly, but the report region does not.
      The report region seems to be be one refresh behind the collection.
      Also each list has a default value, but when I first go to the page the values are not set in session state. I have to refresh a list to get the values in session state and then the collection is created.

      Any ideas please

      Gus
        • 1. Re: Refesh Region
          Gus C
          I have solved part of the problem.
          I have moved my create collection to On Load- Before Header.
          Now the collection is created first and then the report. So they are now ok.

          The problem is when you go to the page for the first time, no data is displayed in the report.
          This is because the collection is created before the page item (parameters) are rendered

          Any ideas ?

          Gus
          • 2. Re: Refesh Region
            fac586
            Gus C wrote:
            I have solved part of the problem.
            I have moved my create collection to On Load- Before Header.
            Now the collection is created first and then the report. So they are now ok.

            The problem is when you go to the page for the first time, no data is displayed in the report.
            This is because the collection is created before the page item (parameters) are rendered
            The item Source and Default properties are used to set the item value rendered on the page, not in session state (you can see this by using the Session viewer when the page is first rendered). Values set in this way (or those the user has subsequently modified them to) are not set in session state until the page is submitted.

            Set the default values using Before Header Computations or Processes.
            • 3. Re: Refesh Region
              Paul Broughton
              Hi Gus,

              I haven't tested this but have you tried to creating onload before header Computations that set the page items and fire prior to the loading of the collections.

              As you would only want this to fire the first time you visited the page you need to add a condition to the computations based on a request value or something similar

              Hope this helps

              Paul
              • 4. Re: Refesh Region
                Gus C
                I have wriiten the process to set the default values.
                Page Process - On Load Before Header. With a sequence number less than the Create Collection process
                declare 
                v_system number;
                v_config varchar2(400);
                v_jobname varchar2(400);
                
                begin
                
                select min(system) into v_system 
                from etl_job_config 
                where config like 'SUP_%';
                
                select min(config) into v_config 
                from etl_job_config 
                where system = v_system 
                and config like 'SUP_%';
                
                select jobname into v_jobname 
                from etl_job_config 
                where system = v_system
                and config = v_config
                and jobsequence = 
                                (select min(jobsequence) 
                                 from etl_job_config 
                                 where system = v_system
                                 and config = v_config
                                 and config like 'SUP_%');
                
                :P6_SYSTEM := v_system;
                :P6_CONFIG := v_config;
                :P6_JOBNAME := v_jobname;
                end;
                Condition
                :P6_SYSTEM is null.

                This runs fine when I first go into the page and sets the defaults for the select lists and in session state.
                First problem is I need the defaults for List2 and List3 to be set, whenever List1 is changed.
                List1 - SYSTEM. This is the parent.
                Page Action is redirect and set value.
                Code for lov
                select system display_value, system return_value from etl_job_config where config like 'SUP_%' group by system order by 1
                List 2 - CONFIG. LOV Parent is List1.
                Page Items To Submit P6_SYSTEM,P6_CONFIG.
                Page Action is redirect and set value.
                Code for lov
                select config display_value, config return_value from etl_job_config where system=to_number(:P6_SYSTEM) and config like 'SUP_%' group by config order by 1
                lIST3 - JOBNAME. LOV Parent is List2
                Page Items To Submit P6_SYSTEM,P6_CONFIG,P6_JOBNAME.
                Page Action is redirect and set value.
                Code for lov
                select jobname display_value, jobname return_value from
                ( select jobname, jobsequence from etl_job_config where system=to_number(:P6_SYSTEM) and config=:P6_CONFIG and config like 'SUP_%' group by jobname, jobsequence order by jobsequence)
                The second problem is, if I change List1. Then List1, List2 and List3 are updated on the page
                but only List1 and List2 are updated in session state.

                Help appreciated

                Gus

                Edited by: Gus C on Dec 13, 2012 2:34 AM