Thanks in advance! Not sure what I'm doing wrong, maybe it's just a syntax thing. Anyway - I have a button, and when it's clicked I want it to change a container Tab to have selectedIndex of 0. In effect, this would just switch what tab the current tabbed container is showing.
I have tried to use Control Component, and run script (here it is)
internalNavBar.selectedIndex = 0 but I'm not sure why anything is working.
Anyone got a simple and good idea?
Hey, I've been confused by that too before.
selectedIndex is only used for reading the value. If you want to update it, you have to call the
In your case:
Hey there! Thanks. That's not working for me.
I have it in a click handler on a button using the Run Script event handler, and it does nothing when clicked. Any idea why?
Can't see any method similar to setCurrentViewIndex?
Another option is to directly control the component from where you set the even handler. Just select Action to be Control component:
This worked. I had to target the container instead of the navBar itself. Thank you so much! SOLVED.
Oh, I thought internalNavBar was the id of the tabbed container. Glad to hear it worked