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
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

NavigationPane within TabbedPane

Is it possible to have a NavigationPane within the root TabbedPane? According to this it seems so.

 

https://developer.blackberry.com/cascades/reference/bb__cascades__tabbedpane.html

 

I would like to have one tab for muliple pages using the NavigationPane to allow me to go back to prev page.

 

Basically I have a series of list pages I want the user to navigate through, each one being its own Page. I want those lists under a Browse tab.

 

This will not work.

 

TabbedPane {

    Page {

        id: page1

        paneProperties: TabbedPaneProperties {

            title: "Tab 1"

        }

    }

    Page {

        id: page2

        paneProperties: TabbedPaneProperties {

            title: "Tab 2"

        }

    }

    

    NavigationPane {

        id: navigationPane

        Page {

            Label { text: "Page1" }

        }

        Page {

            Label { text: "Page2" }

            paneProperties: NavigationPaneProperties {

                backButton: ActionItem {

                    title: "Page1"                    

                    onTriggered: { navigationPane.popAndDelete(); }

                }

            }

        }

    }

}

 

But I do see the weather app does things the other way around but thats not exatly what I want.

 

 

NavigationPane {

    id: navigation

 

    TabbedPane {

        id: mainTab

.....

 

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Please use plain text.
Developer
dbigham
Posts: 469
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: NavigationPane within TabbedPane

My intuition is that the UI designers of BB10 would cringe at a navigation pane being inside of a tabbed pane, but I could be wrong.

 

I can definitely understand wanting to do that though, it seems perfectly natural.

Please use plain text.
Developer
BeroboInc
Posts: 123
Registered: ‎07-08-2011
My Device: Torch 9800, Bold 9700
My Carrier: Bell, Rogers

Re: NavigationPane within TabbedPane

I think I could just have one page and view/hide or repopulate the list and then add a page action for going back which would show up on the far right of the tab bar. I would have hoped for a solution more managed by cascades ui.

Berobo Inc.
Police Scanner Radio / Alarm Clock lets you listen to Police scanners in your area!
http://www.berobo.com
_________________________________________________
Please click the Like button to thank the user that has helped you and
please mark post as solved when you have found the solution to your problem.
Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: NavigationPane within TabbedPane

Read this post. I believe your idea is the same this guy show :

 

http://supportforums.blackberry.com/t5/Cascades-Development/Best-Practices-for-Switching-between-Vie...

 

Putting NavigationPane inside TabbedPane is a bit odd resource.

 

SegmentedControl is the answer :Yes:

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Contributor
oddiofile
Posts: 26
Registered: ‎04-05-2013
My Device: Z10
My Carrier: t-mobile

Re: NavigationPane within TabbedPane

[ Edited ]

You can see an example doing exactly this in the WeatherGuesser cascades example, which I just downloaded.

 

https://developer.blackberry.com/cascades/sampleapps/#lightboxguess

 

The problem is, once you push a page on the NavigationPane, you can't see the Tab menu anymore. It is hidden by the back button.

What is stupid is that when you set the NavigationPane's property "showBackButton" to false, it still totally hides the tabs whenever you push a page. I think that is a bug. But maybe it's just an imposed style.

 

It would be nice if the tab menu could switch between pages even if they had other navigationpanes pushed on top of them. But it looks like SegmentedControl is what people use if they want to have multiple sub-pages in a tab. Except then you have to change your sub-pages into containers, implement swipe gesture recognizers and animate the transitions yourself.

 

 

 

 

ics.com - Where Qt experts work.
Please use plain text.
New Contributor
danny6514
Posts: 3
Registered: ‎04-20-2013
My Device: Z10
My Carrier: Telus

Re: NavigationPane within TabbedPane

Or you can hold onto the back button in your navigation pane, and slide it right. See what happens.

Please use plain text.
New Developer
DrKaoliN
Posts: 4
Registered: ‎05-28-2014
My Device: Z10
My Carrier: Vodafone

Re: NavigationPane within TabbedPane

[ Edited ]

Yes, you can do it like so: 

 

import bb.cascades 1.2

TabbedPane {
    Tab {
       NavigationPane {
Page {
} } } }
Please use plain text.
Developer
Tobster_
Posts: 224
Registered: ‎07-20-2012
My Device: Blackberry Z10 (White), BlackBerry Dev Alpha C
My Carrier: O2 UK

Re: NavigationPane within TabbedPane

You can simply add the navigation pane within a tab which is within a tabbed pane. The reason it's not working for you is because you are attempting to the navigation pane on the outside of the tabbed pane - it needs to be on the inside.

Copy the code posted by @DrKaoliN above and it will work perfectly for you
Please use plain text.