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
smartek
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
Accepted Solution

how to navigate back to the initial page with a NavigationPane

Hi, is there a method with which I can navigate back to the initial page of a application which uses a NavigationPane?

The user should not have the possibility to navigate "back" anymore.

Plase "+Like" my post if it was helpful.
Developer
hakimrie
Posts: 82
Registered: ‎07-23-2009
My Device: 9900

Re: how to navigate back to the initial page with a NavigationPane

have you tried function navigateTo ?

 

navPane->navigateTo(firstPage);

 

 

 

New Contributor
Kamil_ek
Posts: 8
Registered: ‎01-08-2013
My Device: 9790

Re: how to navigate back to the initial page with a NavigationPane

I have the following situation. First file, main.qml:

import bb.cascades 1.0
import bb.data 1.0

NavigationPane {
    id: nav
    
//... Page { id: mainScreen //... onTriggered: { clearSelection(); select(indexPath); var sList = allListsModel.data(indexPath) selectedList = sList.list_name var page = listPage.createObject(); nav.push(page); } } }

 The 'page' creates fine, it is defined in another, listPreview.qml file. There I have a button, and I want to navigate back:

import bb.cascades 1.0
import bb.data 1.0

Page {    
    id: listPreviewPage

    // ...

   actions: [
        ActionItem {
            // ...
            onTriggered: {
                
                // SOME SQL QUERIES

                nav.navigateTo(mainScreen);
            }
        }
    ]

 But nothing happens after clicking. nav.pop() does not work also. However, the SQL queries are performed, so I conclude the button is properly 'tied' to this action. What's wrong here?

 

 

Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook

Re: how to navigate back to the initial page with a NavigationPane

I suspect your issue is because the nav object isn't accessible from the other QML. If you view the device log by running "slog2info -w" in a SSH session you'll see the actual QML error which should confirm the theory.

Either add a signal on the second QML file that signals back to the main page to pop, or add a property and pass in a reference to the nav object.
--------
Taylor Byrnes