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
Contributor
peter_betos
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook
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.

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

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
peter_betos
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook

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

Not working.. Sad to say. :No:

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

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
peter_betos
Posts: 22
Registered: ‎10-20-2011
My Device: Playbook

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

Whoa! It worked. Thanks a lot :smileyhappy:

 

The format is:


onCreationCompleted: {
activeTab = <your preferred tabID>
}

Developer
MatthewGeomax
Posts: 39
Registered: ‎02-06-2013
My Device: Developer - BB10 Dev B

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.