Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Bluenoser
Posts: 254
Registered: ‎04-04-2012
Accepted Solution

Switching tabs in TabbedPane

Hi,

 

  How does one switch to a specific Tab when you click on an ActionItem in another Tab?

 

Thanks in advance.

Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Switching tabs in TabbedPane

Hi there,

 

In order to switch tabs, you need to use the 'activeTab' property.

1) Make sure your Tab object in QML contains an id:

 id: tabbedPane

 

2) Make sure your tabs contain ids as well:

id: actualTab2

 

3) in your current tab's ActionItem's onTriggered routine, call the following:

tabbedPane.activeTab = actualTab2;

 

Let me know if this works for you;

 

Martin

 

Please use plain text.
Developer
d3v3l0p3r
Posts: 152
Registered: ‎07-19-2012
My Carrier: Carrier

Re: Switching tabs in TabbedPane

Is there a way to add a transition. By default the new tab just switches in a blink, what if I want to slide to the new tab or something similar?

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
BlackBerry Development Advisor (Retired)
mgoulet
Posts: 329
Registered: ‎05-07-2012
My Carrier: N/A

Re: Switching tabs in TabbedPane

Hi,

 

Unfortunately not at the moment - This feature or the ability to customize it may come in the future. It would be a great feature request, however:

https://www.blackberry.com/jira/secure/Dashboard.jspa

 

Cheers,

 

Martin

 

Please use plain text.
New Contributor
proudchild
Posts: 7
Registered: ‎09-25-2012
My Carrier: Claro

Re: Switching tabs in TabbedPane

Just to add to the answer, you also can use the index of the tabs (considering you know the index) like:

tabMain.activeTab = tabMain.at(0);

where tabMain is your TabbedPane.
Please use plain text.