4 Replies Latest reply: Nov 30, 2013 2:11 PM by gbrownct RSS

    REGION_STATIC_ID Usage

    gbrownct

      I have a a hide-show region in page 0 that I want to reference (from javascript) on every page. This works fine if I refer to it by the internal region number assigned on each page (ie region13, region14, etc), but there are a couple problems.

      Prob 1. I have to go to each page and determine that regionN identifier. I did this and can make my hide-show region visible on page load.

      Prob 2. When I move app (via export/import) to any other database the regionID number changes and I have to go update each page again.

       

      I want to use the Static ID attribute but don't know how. If I set static ID of the page 0 hide-show region to NAVTREE, how can I refer to it in the javascript below, which I put in the HTML header of each page:

      <script type="text/javascript">

         function showNavRegion() {

            hideshow('regionN');

         }

         window.onload=showNavRegion;

      }

        • 1. Re: REGION_STATIC_ID Usage
          scott.wesley

          I'm not sure what your hideshow function does, but this will do the same job - using the same static ID for yoru regions.

          $x_Hide('NAVTREE');

           

          JavaScript APIs

           

          Alternatively, you can use APEX_APPLICATION_PAGE_REGIONS to interrogate the ID dynamically for each environment - but you might as well stick with JS.

           

          Or you could re-visit why you have different regions on each page and ask yourself if there could be one region defined on the global page zero.

          • 2. Re: REGION_STATIC_ID Usage
            fac586

            gbrownct wrote:

             

            I have a a hide-show region in page 0 that I want to reference (from javascript) on every page. This works fine if I refer to it by the internal region number assigned on each page (ie region13, region14, etc), but there are a couple problems.

            Prob 1. I have to go to each page and determine that regionN identifier. I did this and can make my hide-show region visible on page load.

            Prob 2. When I move app (via export/import) to any other database the regionID number changes and I have to go update each page again.

             

            I want to use the Static ID attribute but don't know how. If I set static ID of the page 0 hide-show region to NAVTREE, how can I refer to it in the javascript below, which I put in the HTML header of each page:

            <script type="text/javascript">

               function showNavRegion() {

                  hideshow('regionN');

               }

               window.onload=showNavRegion;

            }

            It would also be a good idea to use a Dynamic Action defined on the global page (Page 0) instead of repeating hard-coded JS on each page.

            • 3. Re: REGION_STATIC_ID Usage
              gbrownct

              There is one region I want to effect. The hide/show region with ID NAVTREE is defined on Page 0.

              I assume you meant x_Show because x_Hide completely hides the region. But I want the hide/show region to 'show' as in drop-down. When I use $x_Show('NAVTREE') the region label remains visible but the region itself does not expand.

               

              And I'd love to use a single dynamic action on page 0 but until I figure how to expand the hide/show region I can't get that to work either.

              • 4. Re: REGION_STATIC_ID Usage
                gbrownct

                Okay. I do not understand why I can't get regions based on the 'Hide and Show Region' template to SHOW referencing it by its StaticID. However, I did manage to piece together a similiar result using a page-item (checkbox) and dynamic actions to use the $x_Hide and $x_Show() functions to hide/show my navigation region. Main goal, to have it all contained within Page0 AND use Static ID, now accomplished.

                 

                Thanks for everyone's input.