5 Replies Latest reply: Mar 25, 2013 9:15 PM by M Tajuddin RSS

    SHOW HIDE REGION

    kp2000
      Hello
      i have 3 regions on same page

      I have one dynamic action for setting the values for the region 1.[whenever change happens for location no set values for address details]
      when location no change, all other information will be pulled like street address, city, etc.,

      I need (may be ) 2nd dynamic action to show/hide 3rd region.

      If Ist region values are not null and 2nd region(full of check boxes) values are set to Y
      then i need to show 3rd region. If not hide that

      I created a java script and its like this;
      <script type="text/javascript">
      function hideOrderInformation(){
           var regItem11 = $("#P1_ALIST_LOCATION_NUM").val();
           
                     
           if(regItem11 !== '')
           
           {
                $("#reg3").show();
           }
           
           }

      </script>



      But when i implement this 2nd dynamic action even the 1st dynamic action[pulling address info. for location no change] is not firing.


      any ideas appreciated

      thanks
      kp
        • 1. Re: SHOW HIDE REGION
          jariola
          Hi,

          What is your APEX version?
          In dynamic action there is action show and hide. Why you do not use those?

          It might help if you create example about problem to apex.oracle.com.

          Regards,
          Jari
          -----
          My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
          Twitter: http://www.twitter.com/jariolai
          • 2. Re: SHOW HIDE REGION
            kp2000
            Hi
            THanks for the reply. I am on 4.1
            in dynamic action , i dont know how to include my conditions.

            1)
            In first region i got 6 fileds to by not null
            & in 2nd region i got 6 fileds in check box to be=Yes

            Above combination needs to be incorporated in the dynamic action...but i dont know how

            2)Also, I have another dynamic action : pulling address based on location no. THis does not work the moment I want to include any opther dynamic action.

            SO i need to combine bothe 1 and 2

            appreciate your help

            thanks
            kp

            Edited by: kp2000 on Mar 24, 2013 2:09 PM
            • 3. Re: SHOW HIDE REGION
              M Tajuddin
              Hi KP
              I can see error in your javascript. If you are using APEX 4.1 you can try something like this using jQuery -
              $(function () {
                  $('#reg3').hide();
              
                  $("#submit").click(function ()
              
                  {
                      var regItem11 = $("#P1_ALIST_LOCATION_NUM").val();
                      //alert(regItem11);
                      if (regItem11.length != 0) {
              
                          $('#reg3').show();
                      }
                  });
              
              });
              I have done this on button click trigger but you can implement this on select list change or any item value change.

              Here is an example of the above script in jsfiddle - http://jsfiddle.net/ZeGQr/

              Hope that helps.

              Kind regards,
              Tajuddin
              Blog: http://tajuddin.saradesh.com
              • 4. Re: SHOW HIDE REGION
                kp2000
                Hi Taju,
                Thanks a lot..Only one more issue i am facing..

                When the page is freshly loaded, then 3rd region should be hidden.
                So on page html header i got a fn called "init"

                function init(){
                $("#REG3").hide();
                }


                On Page HTML Body Attribute
                onload="init()"

                But after the initial load, during the page submission, on 3RD region REG3, if i have done some mistake, validation fires.
                WHen validation (standard validation) fires, 3rd region is hidden..I don't want that to happen..

                How to do that
                please help

                thanks
                kp
                • 5. Re: SHOW HIDE REGION
                  M Tajuddin
                  Hi
                  You can extend your init function to check the item value before show/hide the region like this -
                  function init() {
                  
                      if (regItem11.length != 0) {
                          //show the region if codition matches
                          $('#REG3').show();
                      } else {
                          //hide the region if condition does not match        
                  
                          $("#REG3").hide();
                      }
                  
                  }
                  Please mark this question as answered if it works.

                  Cheers,
                  Tajuddin