If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All
Accepted Solution

Can not show a TabbedPane by pushing from the NavigationPane

[ Edited ]

I just made a simple TabbedPane sample. But it is weird that the TabbedPane screen could not be shown after pushing from NavigationPane while the TabbedPane screen did show the log when successfully onCreationCompleted.

 

May someone know what is wrong with my code? Thank you so much.

 

main.qml

NavigationPane {
    id: nav
    Page {
        Container {
...
onTriggered: { var page = tabbedPage.createObject(); nav.push(page); }
...

attachedObjects: [
        ComponentDefinition {
            id: tabbedPage
            source: "tabbedPage.qml"
        }
]

 

tabbedPage.qml

// Tabbed Pane project template
import bb.cascades 1.0

TabbedPane {    
    showTabsOnActionBar: true
    Tab {
        title: qsTr("ABC")
        Page {
            id: tab1
            Container {
                Label {
                    text: "Text ABC"
                }
            }
        }
    }
    Tab {
        title: qsTr("123")
        Page {
            id: tab2
            Container {
                Label {
                    text: "Text 123"
                }
            }
        }
    }
    onCreationCompleted: {
        // this slot is called when declarative scene is created
        // write post creation initialization here
        console.log("TabbedPane - onCreationCompleted()")
    }
}

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
strobejb
Posts: 267
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: Can not show a TabbedPane by pushing from the NavigationPane

it's not possible to put a tabbedpane in a navigationpane. It needs to go the other way around. Have the TabbedPane as your root element
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Can not show a TabbedPane by pushing from the NavigationPane

[ Edited ]

Becaue the business requirement is that the first page is a control panel, click each function on the control panel to enter into a tabbed screen.

 

Do you know whether we must use navigation to push a screen or not? Is there any other way to go to the next screen?

 

Or how can we implement clicking a button to show a new screen within the app without NavigationPane?

 

Thank you




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
strobejb
Posts: 267
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: Can not show a TabbedPane by pushing from the NavigationPane

Yes you can put a TabbedPane inside a sheet - so that would be your best option for your scenario

Just open the sheet and it will appear full screen (it doesn't get added to the navigation stack) - and you can have a complete UI within the sheet, starting with TabbedPane
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Can not show a TabbedPane by pushing from the NavigationPane

[ Edited ]

My business requirement only allows "about us" or "feed back" as the sheet type screen. It specifies the tabbed page must use transition to be shown that means must transit to the next page.

 

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Can not show a TabbedPane by pushing from the NavigationPane

[ Edited ]

Thank you for your suggestion, Strobejb, finally we decided to change the design idea to open a sheet with tabbedpane.




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Can not show a TabbedPane by pushing from the NavigationPane

I just think about another senario. If the first page is the login screen after login then go to a home tabbed screen, how can we design this work flow if it is not possible from Navigation to TabbedPane?

 

 




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Can not show a TabbedPane by pushing from the NavigationPane

The limitation RIM has created by blocking a navigation pane from being shown before a tabbed pane has caused me headaches. Showing navigation flow before entering a tabbed pane is common and a number of my clients demand their apps have this behavior. Fortunately, there is an easy solution.

A trick I use is showing a tabbed pane first, then immediately push a the navigation pane. The user can't tell the tabbed pane is shown first because it happens so fast.

Scott
Please use plain text.
Developer
javayoung
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: Can not show a TabbedPane by pushing from the NavigationPane

Thank you Scott. 

 

I am using similar way as yours but changed into immediately pull up a sheet of login.  lol




p(^_^)q
Good good study, day day up
Please use plain text.
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Can not show a TabbedPane by pushing from the NavigationPane

Another idea is to only have one tab on the tabbed pane that contains the first screen. Having a tab bar with only one tab will hide the tab bar all together. Then after the user leaves the first screen you can populate the tab bars with more tabs and delete the tab used for the first screen.

 

It's still a hack though. They need to fix this.

 

Scott

Please use plain text.