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
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline
Accepted Solution

NavigationPane stack

I need 5 or more pages load into stack using NavigationPane.

First page -> second Page -> next Page -> n Page

How I can implement that? (better if can give qml solution, but c++ good to)
Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: NavigationPane stack

I found simple solution!

 

// File: main.qml
NavigationPane {
    id: navigationPane
    Page {
        Container {
            background: Color.White
            Label { text: "Pre-pushed Page" }
        }
        actions: [
            ActionItem {  
                title: "Push()"
                ActionBar.placement: ActionBarPlacement.OnBar
                onTriggered: {
                    navigationPane.deprecatedPushQmlByString("page.qml");
                }
            }
        ]
    }
}
 
// File: page.qml
Page {
    Container {
        background: Color.White
        Label { text: "Dynamically pushed Page" }
    }
    actions: [
        ActionItem {  
            title: "Push()"
            ActionBar.placement: ActionBarPlacement.OnBar
            onTriggered: {
                 navigationPane.deprecatedPushQmlByString("page.qml");
            }
        },
        ActionItem {  
            title: "Pop()"
            ActionBar.placement: ActionBarPlacement.OnBar
            onTriggered: { 
                 navigationPane.popAndDelete()
            }
        }
    ]
}

 Its work fine if I use new project!!
But in my project it's does not work! Always I see error in page.qml: "ReferenceError: Can't find variable: navigationPane"

Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: NavigationPane stack

I found solution!

 

If you have TabbedPane and included NavigationPane and deprecatedPushQmlByString already used, you can't push next screens!!!!! I think it can be fixed, because its bug.

Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: NavigationPane stack

simple example for implementing

// main.qml

TabbedPane {
    Tab {
        id: mainTab
        MainCustomQMLPage {
        }
    }
    Tab {
        id: secontTab
        SecondCustomQMLPage {
        }
    }
}

// MainCustomQMLPage.qml

NavigationPane {
    id: nav
    Page {
        Button {
        text: "Click me"
            onClicked: {
                nav.deprecatedPushQmlByString("MainCustomQMLPage.qml")
            }
        }
    }
}

 

Developer
Posts: 216
Registered: ‎11-05-2011
My Device: Z10
My Carrier: Beeline

Re: NavigationPane stack

P.S. latest implementing is bug for dev team
Developer
Posts: 193
Registered: ‎12-29-2010
My Device: Bold 9900
My Carrier: Rogers

Re: NavigationPane stack

Hi,

 

I can't get your 2nd example to work for me.

I created a new MainCustomQMLPage.qml file that is a NavPane.

 

In the main.qml file, I put in the MainCustomQMLPage in the first mainTab, but I get the following error:

 

Empty property assignment
            MainCustomQMLPage {
            ^) 

QmlDocument:createRootNode document is not loaded or has errors, can't create root 

 

Any ideas?