9 Replies Latest reply: Dec 7, 2012 1:05 AM by Baki Sine RSS

    Need to display region in open mode in Hide and show Region

    Vedant
      Hi,
      I am using apex 4.1.
      i have created form with report page and using region template show and hide. i want when i click on create button or edit link then all the region on page should be in open mode show in (-) by default it show me in(+) Mode. i need to display region in (-) Open not in(+) Mode.


      How can i do this?










      Thanks & Regards
      Vedant

      Edited by: Vedant on Sep 26, 2012 12:07 AM

      Edited by: Vedant on Sep 27, 2012 12:25 AM
        • 1. Re: SHOW HIDE template
          Aljaz
          Hi,

          what theme are you using?

          Regards,
          Aljaz
          • 2. Re: SHOW HIDE template
            Aljaz
            • 3. Re: SHOW HIDE template
              Vedant
              Hi,
              I am using theme 13(BLUE GRAY).

              I have apply code as it is. do i need to change name of the region with static values or no need to change the static values?

              It is not working if i apply as it is to the region footer.

              Edited by: Vedant on Sep 26, 2012 2:14 AM
              • 4. Re: SHOW HIDE template
                Aljaz
                 
                • 5. Re: Need to display region in open mode in Hide and show Region
                  965201
                  Hi,

                  Change image src in ur Region Template from img src="#IMAGE_PREFIX#themes/theme_20/collapse_plus.gif" to img src="#IMAGE_PREFIX#themes/theme_20/collapse_minus.gif" and also change style value to style=""

                  Edited by: Dil8k_1984 on Oct 1, 2012 1:54 AM

                  Edited by: Dil8k_1984 on Oct 1, 2012 1:54 AM

                  Edited by: Dil8k_1984 on Oct 1, 2012 1:55 AM
                  • 6. Re: Need to display region in open mode in Hide and show Region
                    Vedant
                    Dear Friend,

                    i am using Theam 13 but below code compatible with theme 23.

                    i have try below code but this use with theme 23.
                    Hi,
                    
                    What has to be done is:
                    Set up STATIC ID for all regions except for first region.
                    
                    For example:
                    REGIONTWO
                    REGIONTHREE
                    REGIONFOUR
                    REGION FIVE
                    
                    Then go to Page properties to section Head and Footer. In footer section add this:
                    
                    
                    
                    <script>
                    $('#REGIONTWO .uRegionContent.clearfix').css('display','none');
                    $('#REGIONTWO .uRegionControl').addClass('uRegionControl uRegionCollapsed');
                     
                    $('#REGIONTHREE .uRegionContent.clearfix').css('display','none');
                    $('#REGIONTHREE .uRegionControl').addClass('uRegionControl uRegionCollapsed');
                     
                    $('#REGIONFOUR .uRegionContent.clearfix').css('display','none');
                    $('#REGIONFOUR .uRegionControl').addClass('uRegionControl uRegionCollapsed');
                     
                    $('#REGIONFIVE .uRegionContent.clearfix').css('display','none');
                    $('#REGIONFIVE .uRegionControl').addClass('uRegionControl uRegionCollapsed');
                    </script>
                    
                    
                    
                    P.S. If you change to some other theme you have to check if classes are the same. Otherwise it will not work.
                    How can i open default in (-) form.when i use hide and show region.


                    Thanks
                    • 7. Re: Need to display region in open mode in Hide and show Region
                      Aljaz
                      Hi,

                      just noticed that I posted empty post.

                      Change your Hide and Show Region in Template section into
                      <table class="t13FormRegion" cellpadding="0" cellspacing="0" border="0" summary="" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
                      <thead class="t13RegionHeader">
                      <tr>
                      <th class="t13RegionTitle">#TITLE#<img src="#IMAGE_PREFIX#themes/theme_13/minus.gif" onclick="htmldb_ToggleWithImage(this,'#REGION_ID#Body')" style="margin:0 5px;" class="pseudoButtonInactive" /></th>
                      <th class="t13RegionButtons">#CLOSE#  #PREVIOUS##NEXT# #DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</th>
                      </tr>
                      </thead>
                      <tbody id="#REGION_ID#Body" style="display:table-row-group;">
                      <tr>
                      <td colspan="2" class="t13RegionBody">#BODY#</td>
                      </tr>
                      </tbody>
                      </table>
                      One more suggestion, it is better to copy Hide and Show Region to new template and modify that template (set class to Hide and Show Region).

                      Edited by: Aljaz on 4.10.2012 21:23
                      • 8. Re: Need to display region in open mode in Hide and show Region
                        Bobster13
                        This is for future forum views...

                        If you want the Hide and Show region to be open by default...

                        Copy the Hide and Show region > rename it Show and Hide

                        DON'T modify the existing template or it will affect the region everywhere!

                        In the Definition section is the code that defines the region...toward the bottom is Div class = hide

                        change to: Div class = show
                        • 9. Re: Need to display region in open mode in Hide and show Region
                          Baki Sine
                          Hi

                          I ve used apex 4.2. EPG and theme 25.

                          If you need conditional hide and show region,
                          Put functions in js file or page head, set static region id and use dynamic action on page load and call javacript functions, set conditions.


                          function showRegion(regionId) {
                          $('#'+regionId).find('a.uRegionCollapsed').removeClass("uRegionCollapsed");
                          $('#'+regionId).find('div.uRegionContent').css('display', 'block');
                          }

                          function hideRegion(regionId) {
                          $('#'+regionId).find('a.uRegionControl').addClass("uRegionCollapsed");
                          $('#'+regionId).find('div.uRegionContent').css('display', 'none');

                          }


                          if you want use cookies to remeber last state of region [http://blucel.co.uk/index.php/2011/11/23/oracle-apex-stick-hide-and-show-regions/]

                          Regards

                          Edited by: Baki Sine on Dec 6, 2012 11:03 PM

                          Edited by: Baki Sine on Dec 6, 2012 11:04 PM

                          Edited by: Baki Sine on Dec 6, 2012 11:05 PM