Search code examples
blackberry-cascades

blackberry 10 cascades tabbedpane


i have used NavigationPane in Sign.qml page,After user Logins it will go to Homescreen.qml in Homescreen.qml i have used TabbedPane, while clicking the Login button (Signin.qml)i am getting response,but can't able to go to Homescreen.qml

hereby i have attached my code Signin.qml

    NavigationPane {
              id: navigationPane
          Page {

    attachedObjects: ComponentDefinition {
        id: pageDefinition
        source: "HomeScreen.qml"
    }
    Container {
        Button {
            text: "Login"
            onClicked: {
                //check if is credentials are valid or not
                if(isValidUser())
                {
                    var page = pageDefinition.createObject();
                    navigationPane.push(page);
                }
                else
                {
                    //show error message
                }
            }
        }
    }
}}

and my Homescreen.qml code

       import bb.cascades 1.0

           TabbedPane {
             id: mainTab
             showTabsOnActionBar: true 

Tab {
       title: "Home"
       imageSource: "asset:///menuicons/home.png"

        Signin {
           id: signin
       }
   }
Tab {
    title: "Home"
    imageSource: "asset:///menuicons/home.png"

     Editnew {
        id: homepage
    }
}
Tab {
    title: "Messages"

    Messages {

    }
}

Tab {
    title: "Search"

    Search{

    }
}
Tab {
    title: "Feeds"

    Feeds {

    }
}

Tab {
    title: "Nearby"

    Nearby{

    }
}
Tab {
    title: "Followers"

    Followers {
        id: foll
    }
}
Tab {
    title: "Group"

    Groups {
        id: groups
    }
}

i cant able to view Homescreen.qml while clicking login button from sign-in,can anyone give me some idea how to do this..?


Solution

  • You can not push a TabbedPane inside a NavigationPane. It's best practice to use TabbedPane at top of application flow and if you want to go deeper, you can use NavigationPane inside a TabbedPane.

    Still there's a workaround for you. You can put your TabbedPane inside a sheet and open that sheet rather than pushing in on NavigationPane.

    attachedObjects: Sheet {
                id: tabbedPaneSheet
                Homescreen{
                }
        }
    ...
    onClicked{
        tabbedPaneSheet.open()
    }
    ...