6 Replies Latest reply: Jan 4, 2013 2:49 PM by Steve.1234555-Oracle RSS

    hiding regions on page load?

    Steve.1234555-Oracle
      I have a page which, upon page load, some regions should be hidden. I've created a dynamic action which hides a couple regions (on page load), however I can see the regions for a moment as the page is loading, then disappear. Is there a way to ensure the regions are hidden when the page is rendered?

      I've also tried using javascript, but I have the same issue (the regions are visible for a moment, then disappear).

      Thanks,
      Steve
        • 1. Re: hiding regions on page load?
          fac586
          Steve wrote:
          I have a page which, upon page load, some regions should be hidden. I've created a dynamic action which hides a couple regions (on page load), however I can see the regions for a moment as the page is loading, then disappear. Is there a way to ensure the regions are hidden when the page is rendered?

          I've also tried using javascript, but I have the same issue (the regions are visible for a moment, then disappear).
          Dynamic Actions are JavaScript, so that is entirely to be expected.

          Give the regions static IDs or classes and hide them using CSS in the page header (no APEX version specified so can't be specific on how):
          #region-id-1,
          #region-id-2 {
            display: none;
          }
          • 2. Re: hiding regions on page load?
            Steve.1234555-Oracle
            Thanks for the quick response!

            I'm on APEX 4.2

            I see under MyRegion > Attributes the Static ID field. What is the syntax for entering an id? Do you just enter the region id text directly? (e.g., region1). I also setup the CSS to hide the region, but it's not working:

            #region1 {
            display: none;
            }


            Alternatively, in MyRegion > Header and Footer, I can enter div tags. This partially works. It hides the contents of the region, but not the region border and labels. Plus, I still see the entire region for a moment, then the content disappears.

            Let me know if you have further suggestions...

            Edited by: Steve on Jan 4, 2013 10:00 AM
            • 3. Re: hiding regions on page load?
              fac586
              Steve wrote:
              Thanks for the quick response!

              I'm on APEX 4.2

              I see under MyRegion > Attributes the Static ID field. What is the syntax for entering an id? Do you just enter the region id text directly? (e.g., region1).
              The atribute<tt>id</tt> atribute can be any text string with no whitespace characters, but must be unique within the document.

              The regions must have a template that contains the <tt>#REGION_STATIC_ID#</tt> substitution string.
              I also setup the CSS to hide the region, but it's not working:
              #region1 {
              display: none;
              }
              This has to go in the page <tt>head</tt> element. In 4.2 use the Inline CSS page attribute.
              • 4. Re: hiding regions on page load?
                Steve.1234555-Oracle
                Ok, so I think I've got it, except for the part on the template.

                You're saying that in MyRegion > User Interface > Template, this needs to reference my unique region id? (i.e., "region1"). Currently the template is set to "Reports Region". How do I change the template to include the region id?
                • 5. Re: hiding regions on page load?
                  fac586
                  Steve wrote:
                  Ok, so I think I've got it, except for the part on the template.

                  You're saying that in MyRegion > User Interface > Template, this needs to reference my unique region id? (i.e., "region1"). Currently the template is set to "Reports Region". How do I change the template to include the region id?
                  The Shared Component column on the right of the page definition will contain a link to the "Reports Region" template. Open this and it will show the region template definition, which should contain an element with the <tt>#REGION_STATIC_ID#</tt> substitution string, like:
                  <section class="uRegion #REGION_CSS_CLASSES# clearfix" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
                  ...
                  • 6. Re: hiding regions on page load?
                    Steve.1234555-Oracle
                    Ah, got it. Yes it does contain #REGION_STATIC_ID#. And the page is loading as I want now -- all unnecessary regions are hidden from the get go on page load (i.e., they don't flash momentarily and then hide).

                    Thanks for the help!!