Forum Stats

  • 3,839,011 Users
  • 2,262,438 Discussions
  • 7,900,835 Comments

Discussions

Region display selector focus issue

Balaji Madhavan
Balaji Madhavan Member Posts: 35
edited Sep 26, 2019 3:40AM in APEX Discussions

Dear Friends,

I have a Region display selector with tabs container template and I have various regions in that and I need to focus a particular region on page load how can I do this is it possible in apex version 5.1

by default, the first region is set as a selected region. Thanks in advance

Regards,

Balaji Madhavan

Tagged:

Answers

  • Scott Wesley
    Scott Wesley Member Posts: 6,237 Gold Crown
    edited Sep 26, 2019 3:12AM

    Have you considered executing something like this, on page load?

    $('#REGIONX_tab a').trigger('click');

    as described here

    https://svenweller.wordpress.com/2018/11/27/apex-quickie-set-region-display-selector-dynamically/

    Balaji Madhavan
  • Franck N
    Franck N Member Posts: 1,019 Silver Trophy
    edited Sep 26, 2019 3:13AM

    HI,

    Give a static ID to your region and trigger this code on an event of your choosing.

    The following example will focus the region with Static ID "myRegion".

    <span class="kwd" style="color: #8959a8;">var</span><span class="pln" style="color: #4d4d4c;"> region </span><span class="pun" style="color: #4d4d4c;">=</span><span class="pln" style="color: #4d4d4c;"> apex</span><span class="pun" style="color: #4d4d4c;">.</span><span class="pln" style="color: #4d4d4c;">region</span><span class="pun" style="color: #4d4d4c;">(</span><span class="pln" style="color: #4d4d4c;"> </span><span class="str" style="color: #718c00;">"myRegionId"</span><span class="pln" style="color: #4d4d4c;"> </span><span class="pun" style="color: #4d4d4c;">);<br/></span><span class="pln" style="color: #4d4d4c;"> region</span><span class="pun" style="color: #4d4d4c;">.</span><span class="pln" style="color: #4d4d4c;">focus</span><span class="pun" style="color: #4d4d4c;">();</span>

    regards,

    Franck

    Balaji Madhavan
  • Balaji Madhavan
    Balaji Madhavan Member Posts: 35
    edited Sep 26, 2019 3:20AM

    <span class="kwd" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #8959a8;">var</span><span class="pln" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;"> region </span><span class="pun" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;">=</span><span class="pln" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;"> apex</span><span class="pun" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;">.</span><span class="pln" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;">region</span><span class="pun" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;">(</span><span class="pln" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;"> </span><span class="str" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #718c00;">"myRegionId"</span><span class="pln" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;"> </span><span class="pun" style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #4d4d4c;">);</span>

    in this myRegionId is that static ID?

  • Pierre Yotti
    Pierre Yotti Member Posts: 4,040 Bronze Crown
    edited Sep 26, 2019 3:38AM
  • Franck N
    Franck N Member Posts: 1,019 Silver Trophy
    edited Sep 26, 2019 3:40AM

    Yes indeed,

    but i just realized that you are aiming to focus on a tab region.

    so my solution will not work on that case since this will only be effective on regions which are already visible on the page.

    Scott Wesley

    regards,

    Franck