Skip to main content

Search

Open specific tab - Possiblity to open specific tab on conditions

Comments

6 comments

  • ArdeviaForum

    Original Post by Andrii Katsiubka (Imported from Ardevia Forum)

    Yes, it is possible with actions.
    If you want select tab on form opening  you should add Form Load Action.
    If you want to select tab by clicking on button or link you should add link or button with actions.

     

    To select tab you need to add Execute Script action with next code:
    Code

    jQuery("<tab-selector>").click()


    Don't forget to replace <tab-selector> by selector of your tab.
    To make it workable only for users in specific group add next code to Condition field of this action
    Code

    [[@User.IsMemberOfGroup("<Name of the group>")]]


    and replace <Name of the group> by users group name

    0
  • ArdeviaForum

    Original Post by Django (Imported from Ardevia Forum)

    Thanks for replying!
    Wat do you mean by the "selector of your tab" - I guessed it would be the name of the tab but that does not seem to work... the order of the tabs in numbers is also not working...

    0
  • ArdeviaForum

    Original Post by Andrii Katsiubka (Imported from Ardevia Forum)

    By selectot I mean jQuery Selector.
    In you case you need to open Developer Tools (F12 in any browser)
    Click on select element button and select tab.
    Then in html find element id (see image)

     

     

    In an example element id is "ui-id-2" so jQuery selector will be "#ui-id-2"

    0
  • MikeW

    Hello,

     

    I also want to set the focus on a tab (belongs on a condition) so I tried the solution above.

    My Problem is, that some Tabs have the same element id?! The solution works fine with tabs wich have a unique ID.

     

    Does anybody have a hint for me?

     

    Greetings

    Mike

    0
  • Тарас_Lozynskyy

    Hi Mike Welskopf
    In your case, you should use stronger selector

    like 

    jQuery("#WebPartWQ3 #ui-id-2")
    0
  • JeroenS

    Another tip: in a scenario where you for instance want to add a button to the default "save" action like "save and add documents"; as the last action of that new button you can redirect to the editform.aspx?id=[[ID]]&TabSelected=9 

     

    Then in the editform execute the jQuery script action with the condition: 

    =[[@Page.GetQueryString('TabSelected')]]==9

     

    It will redirect users to the editform.aspx with the right tab opened for them to start adding documents (for example). 

     

    Cheers!
    Jeroen

    0

Please sign in to leave a comment.