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
Contributor
Posts: 15
Registered: ‎10-24-2013
My Device: z10
My Carrier: Macadamian
Accepted Solution

Cannot push to navigation pane from a component outside main.qml

[ Edited ]

Here is part of my main.qml

 

 Container {
            id: main_content
            
            attachedObjects: [
                
                ComponentDefinition {
                    id: listtodo
                    source: "mainList.qml"
                }
            ]
            
            property variant listtodoObj
            
            onCreationCompleted: {
                listtodoObj = listtodo.createObject();
                if (!listtodoObj)
                    listtodoObj = listtodo.createObject();
                
                listtodoObj.dataModel = Model.get();	            
                main_content.add(listtodoObj);
            }   
        
        }

 I haven't included NavigationPane but in main, I have a navigation pane with id "navigationPane".

Here is part of my mainList.qml:

gestureHandlers: [
                    
                    TapHandler {
                        
                        attachedObjects: ComponentDefinition {
                            id: infoPage;
                            source: "asset:///taskInfo.qml"                        
                        }
                        
                        onTapped: {
                            
                            var page = infoPage.createObject();
                            
                            navigationPage.push(page);                     
                        
                        }
                    }
                ]    

 

But I cannot access navigationPane. In console it says: "Can't find variable: navigationPage"

 

What can I do?

Highlighted
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Cannot push to navigation pane from a component outside main.qml

this should help:
http://supportforums.blackberry.com/t5/Native-Development-Knowledge/How-to-access-qml-properties-fro...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter