0

I've been trying to research this all weekend, but can't find a similar example. I'm trying to keep a TabPane consistent through out multiple pages. As of right now, once you go past 1 page, the TabPane will no longer be there.

For example:

TabbedPane {
    id: root
    showTabsOnActionBar: true 

    Tab { 
        title: qsTr("Search") + Retranslate.onLocaleOrLanguageChanged
        Search {
        }
    }
}

// Search.qml
NavigationPane {
    id: navigationPane

    Page {
        Button {
            onClicked: {
                navigationPush.push(pageSearchResults.createObject())
            }
        }
    }
    attachObjects: [
        ComponentDefinition {
            id: pageSearchResults
            SearchResults {

            }  
        }
    ]
}

So basically at this point when we're on the Search page, we have the TabPane. As soon as I push that Button and navigate to the SearchResults page. The TabPane is gone...

    // SearchResults.qml
    // We're now 2 pages -IN- from the TabPane
    Page {
        Button {
            onClicked: {
                navigationPush.push(nextPage.createObject())
            }
        }

        attachObjects: [
            ComponentDefinition {
                id: nextPage
                NextPage {

                }  
            }
        ]
    }

Also once we're on SearchResults - it won't let me push the next page. When I click the Button on SearchResults, you can see the navigationPush(nextPage.createObject()). It gives the following error:

pushPage : mNavigationStack : ("211") NavigationPane: NavigationPaneOnFwdTransitionDone: emitting push transition ended for page: 211 client top: 211

Mark Pieszak - Trilon.io
  • 61,391
  • 14
  • 82
  • 96
  • Don't show how you are navigating to the next pages, nor is it clear what you mean by the TabPane disappeared. As a UI object the TabPane exists until it is destroyed. While it exists it can be, or not be, int the current scene graph. – Richard Sep 08 '14 at 00:40
  • Hey @Richard sorry, I can put in more information. Basically within Search or Help pages, I'm just trying to open new `Sheet`'s, and when I do, once those pages are clicked, the TabPane disappears... – Mark Pieszak - Trilon.io Sep 09 '14 at 19:44
  • @Richard Updated the Question with better code & a more refined Question! – Mark Pieszak - Trilon.io Sep 10 '14 at 14:56

1 Answers1

0

What you need to do is add a navigationPane to the tab and push pages onto that.

A sheet should be opened for something seperate to the tab - e.g. a settings page. Sheets also require buttons or code to close them.

It's not clear from your code whether you are using a navigationPane or not, so here is an example of how it should be working:

TabbedPane {
    id: root
    showTabsOnActionBar: true 

    Tab { 
        title: qsTr("Search") + Retranslate.onLocaleOrLanguageChanged
        NavigationPane {
            id: navSearch
            Page {

            }                
        }
    }
}

Now when you want to navigate to the next page in search you will add it to the navSearch navigationPane. This will give you the back button as well.

It would be beneficial to read through the documentation on navigation here: http://developer.blackberry.com/native/documentation/cascades/ui/navigation/index.html

It will explain many details of how the navigation works and how different elements such as tabbed panes and sheets interact.

hyarion
  • 2,251
  • 2
  • 17
  • 28
  • Thanks @Hyarion! I updated my question if you want to take a look. I'm having the most bizarre behavior. The TabPane disappears immidiately after you navigate from the `Search` page, and after that Search page, I can't even `.push()` new pages on the stack... – Mark Pieszak - Trilon.io Sep 10 '14 at 14:57
  • The tabbed pane is meant to dissapear once you push a page. If you tap the back button to close the page you should be back at the tabbed pane. If you want to keep the tabs there permanently then you will need to replace the contents of your page, I think you need to use a delegate/control delegate. The pushing of the nextpage looks fine, I'm not sure why it doesn't work though. The error you are seeing is not an error just some debug info indicating that a page was pushed (i.e. indicates success). Make sure you don't have another navigationpane anywhere with the same name perhaps. – hyarion Sep 11 '14 at 07:25