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
New Developer
Posts: 11
Registered: ‎01-12-2013
My Device: BB10 Dev Alpha / Playbook/ Z10
My Carrier: Vodafone
Accepted Solution

TabbedPane to NavigationPane and back

Hi All

 

 

I'm currently working on an app which has a TabbedPane as it's root control, One of the tabs has a a grid of Buttons which when clicked will display a NavigationPanel which will allow the user to cycle through various pages.

 

The problem I'm having, is how to return to the TabbedPane, once I've finished with the NavigationPane. The closest I've got is to setup a close action in the action menu, which pops the last page and then attempts to reset the view to the tabbed panel using 'Application::instance()->setScene(root);', unfortunatly this causes the app to freeze. 

 

Ideally,  I would like to return to the TabbedPane by using the default back button on the first page, but this seems to be disabled, adding a custom button also fails ie does not display.

 

So, just wondering if I'm missing something, ie does the TabbedPane need recreating ?

 

Thanks for any help, how to integrate various controls seems a bit light on documentation.

 

Thanks and Regards

 

James

 

Developer
Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: TabbedPane to NavigationPane and back

You don't need to return to the tabbed pane - use the following structure:

 

TabbedPane {

  Tab {
    id: tab1
    title: "First Tab"
NavigationPane { id: nav1 Page {
id: page1 /* put your buttons here */ }
onPopTransitionEnded: { page.destroy(); } }
} Tab { id: tab2 } }

 

The structure above will show a blank page in your first tab. There will be no back button along the action bar, and the action bar itself will be invisible unless you put some ActionItems in there. Put your buttons in this first page (put it in a separate QML file to make your main.qml neater).

 

When you press a button in your main page (page1), push an additional page to "nav1" it will be pushed ontop of page1 -  and you will get a back button this time. You don't need to do anything to return to the base page, other than pressing the back button. When the top page gets popped, you'll automatically return to the base base. Make sure to destroy any pages you create in the onPopTransitionEnded handler.

Highlighted
New Developer
Posts: 11
Registered: ‎01-12-2013
My Device: BB10 Dev Alpha / Playbook/ Z10
My Carrier: Vodafone

Re: TabbedPane to NavigationPane and back

Thanks, this was what I started to think, after reading more of the NavigationPane posts.

 

Also this does make a lot more sense.. Smiley Happy

 

Rgds

 

James