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 Contributor
F4bio
Posts: 4
Registered: ‎01-06-2013
My Device: Playbook, Dev Alpha A

Problems with complex Navigation

Hello,

 

I'm currently developing an app with a more advanced Navigation and got stuck.

For example my main.qml

TabbedPane {
    id: tabbedPane
    showTabsOnActionBar: true
    Tab {
        title: "LogIn"
        content: NavigationPane {
            id: navPane
            Page {
                ControlDelegate {
                    id: logincd
                    source: "loginPage.qml"
                    delegateActive: true
                }
                onCreationCompleted: {
                    registercd.delegateActive = true
                }
            }
            attachedObjects: [
                ComponentDefinition {
                    id: feedPage
                    source: "feedPage.qml"
                }
            ]
        }
    } // end of first Tab
    Tab {
        title: "Register"
        content: Page {
            ControlDelegate {
                id: registercd
                source: "registerPage.qml"
            }
        }
    } // end of second Tab
}// end of TabbedPane

 As you see I'm using a NavigationPane inside a TabbedPane with a Dynamic QML component to optimize my loading time but now in my loginPage.qml there is the button which controls the navigationPane but obviously it's in a different QML File and therefore i can't access the navigationPane OR the attached ComponentDefinition.

 

loginPage.qml

import bb.cascades 1.0

Container {
    Label {
        text: "loginPage"
    }
    Button {
        text: "Login"
        onClicked: {
            var newPage = feedPage.createObject();
            navPane.push(newPage);
        }
    }
}

 How can this onClicked event control the navigationPane? Or do i have to pack everything in a big QML file which would result in horrible loading times.

Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: Problems with complex Navigation

Not sure if this is the best method but you can try passing the NavigationPane using the global Qt object. Here's an example on how to do this:

http://supportforums.blackberry.com/t5/Cascades-Development/QML-Accessing-variables-defined-outside-...


Andrey Fidrya, @zmeyc on twitter
New Contributor
F4bio
Posts: 4
Registered: ‎01-06-2013
My Device: Playbook, Dev Alpha A

Re: Problems with complex Navigation

unfortunately that did not work in my example. I think the issue are the different .qml files and I don't know how to interact between them.

New Developer
fetcher
Posts: 9
Registered: ‎01-11-2013
My Device: BB10

Re: Problems with complex Navigation

Did you find a solution as I have exactly the same problem ?