Get the Current Tab Index Value of a uiTabs

Home Forums General Programming Get the Current Tab Index Value of a uiTabs

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #117842
    damien
    Participant
      • Topics: 15
      • Replies: 62
      • Total: 77

      Hi,

      I want to switch tabs of a uiTabs depending of the value of buttons and the currently displayed tab.

      What’s the right LUA expression to get the value of the “Tab Index” that is currently displayed?

      I have the following expression

      ViButConfVal = ViButConf:getModulatorByName("ViButConf"):getModulatorValue()
      ModeTabsVal = ModeTabs:getModulatorByName("ModeTabs"):getCurrentTabIndex()

      ModeTabsVal should return 0,1,2,… depending on the current opened tab.

      then I apply some conditions like :

      if ViButConfVal == 1 and ModeTabsVal == 2 then ...

      I can’t get the Current Index Tab value. Can you please help me with that property?

      thanks a lot

      Damien

      • This topic was modified 4 years ago by damien.
      #117864
      goodweather
      Participant
        • Topics: 45
        • Replies: 550
        • Total: 595
        • ★★★

        Use:
        panel:getComponent("PolyDTabs"):setProperty ("uiTabsCurrentTab", 0, false)

        Where you replace “PolyDTabs”by your tab component name and 0 by the number of the tab you want to display (first tab is 0)

        #117866
        damien
        Participant
          • Topics: 15
          • Replies: 62
          • Total: 77

          Thanks for the reply but it’s not exactly what I was looking for.
          I am looking for the correct way to get the value of the tab that is currently opened but I can’t figure it out.

          Let’s say the tab X is currently opened. I want to be able to get this tab value so that I can create a statement like: If condition “a” and “tab X” is currently open then…

          thanks

          • This reply was modified 4 years ago by damien.
          • This reply was modified 4 years ago by damien.
          • This reply was modified 4 years ago by damien.
          #117870
          goodweather
          Participant
            • Topics: 45
            • Replies: 550
            • Total: 595
            • ★★★

            Well…then the answer is almost there 😉

            panel:getComponent("PolyDTabs"):getProperty("uiTabsCurrentTab")

            will give you the tab number

            #117877
            damien
            Participant
              • Topics: 15
              • Replies: 62
              • Total: 77

              Thanks Goodweather. This is exactly what I needed. I already replied but I don’t know why my answer is not available.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The forum ‘Programming’ is closed to new topics and replies.
            There is currently 0 users and 73 guests online
            No users are currently active
            Forum Statistics
            Threads: 2,495, Posts: 17,374, Members: 77,605
            Most users ever online was 12 on January 22, 2019 3:47 pm
            Ctrlr