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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook
My Carrier: Globe
Accepted Solution

Force Another Tab at Non-zero index to display first

Hi Cascade Devs -

 

How can I force the TabbedPane to display another tab aside from the first one to display first once the app has been opened? I am aware that the trigger for the event is indicated as below:

 

onCreationCompleted: {

<insert method here>
}

 

but it doesn't seem to accept setActiveTab method. Any proper way how to call another tab? Thanks.

Highlighted
Developer
Posts: 17,026
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Force Another Tab at Non-zero index to display first

did you try to set the activeTab property?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook
My Carrier: Globe

Re: Force Another Tab at Non-zero index to display first

Not working.. Sad to say. 

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Force Another Tab at Non-zero index to display first

peter_betos, in case what simon_hain said wasn't clear, he means don't use the setActiveTab() method, but just set the property directly with activeTab = yourTabId.

This should work. If it doesn't can you expand on "not working"? Is it giving an error message? Quietly executing that line but to no effect, or what?

Make sure you take advantage of the log message ability to troubleshoot this. Put a line like print('done setting activeTab') following that line and check that it shows up in the output.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Contributor
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook
My Carrier: Globe

Re: Force Another Tab at Non-zero index to display first

Whoa! It worked. Thanks a lot Smiley Happy

 

The format is:


onCreationCompleted: {
activeTab = <your preferred tabID>
}

Developer
Posts: 41
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B
My Carrier: Rogers

Re: Force Another Tab at Non-zero index to display first

The confusion is related to QML properties automatically mapping getters and setters. So in c++ you'd use setactivetab but in QML the assignment is automatically mapped to the setter for you.