6 Replies Latest reply: Jul 24, 2013 11:36 AM by orton607 RSS

    jquery UI tabs for multiple regions within the page :: Setfocus issue

    orton607

      Hello,

       

      Anyone please help me with a proper approach.

       

      I have used the below link to create jquery UI tabs for my application. I have three data entry form regions in my page and each one of the form is a tab. Each form region has input items for the users to enter data and save the changes.

       

      Tabs within APEX (using jQuery) « Warp11 .::. Oracle Apex Knowledge Group

       

      I am trying to focus the cursor on the first input text item; when the tab index value is equal to 2; I able to alert  a test message; but when i try to set the focus; I am not able to do so. Below is my javascript code. I am using Oracle APEX 4.2.2 version and Oracle 11g r2 database. P1_SELECTED_TAB is an hidden item on the page and this item is part of the container region tab (parent region tab). I placed the below JS code in the region footer section of my parent region tab. I am trying to set the focus for the item named P1_ENAME.

       

      <script type="text/javascript">

      apex.jQuery(function(){

      apex.jQuery("##REGION_STATIC_ID#").tabs({

        selected:'&P1_SELECTED_TAB.',

        select:function(e,u){

         var a=new htmldb_Get(null,&APP_ID.,"APPLICATION_PROCESS=DUMMY",&APP_PAGE_ID.);

         a.add("P1_SELECTED_TAB",u.index);

         var r=a.get();

          if(u.index == 2) { alert('Third Tab');  apex.jQuery("#P1_ENAME").focus(); }

        }

      });

      });

      </script>

       

      Thanks,

      Orton