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
laairoy
Posts: 24
Registered: ‎10-31-2012
My Device: Dev Alpha B
My Carrier: COMPE

[Help] Open NavigationPane in other qml

Helo guys,

 

I need a open NaviPane.qml(NavigationPane) in main.qml. Lest's go.

 

My main.qml

import bb.cascades 1.0

Page {
    Container {
        ListView {
            dataModel: XmlDataModel {
                source: "models/opens.xml"
            }
            listItemComponents: [
                ListItemComponent {
                    type: "titles"
                    Header {
                        title: ListItemData.bar
                    }
                },
                ListItemComponent {
                    type: "contacts"
                    Container {
                        property variant Focus: ListItem.active
                        id: mlist
                        layout: DockLayout {
                        }
                        Label {
                            id: nameColor
                            text: ListItemData.title
                            textStyle.fontSizeValue: 10
                        }
                        attachedObjects: [
                            ComponentDefinition {
                                id: myNPane
                                source: "NaviPane.qml"
                            }
                        ]
                        onFocusChanged: {
                            if (ListItem.active) {
                                var newPane = myNPane.createObject() //Don't working
navigationPane.push(newPane) //Don't working } } Divider { } } } ] } } }

 

My NaviPane.qml

import bb.cascades 1.0

NavigationPane {
    id: navigationPane
    Page {
        Container {
            layout: StackLayout {
            }
            background: Color.create("#f7f3")
            Label {
                text: "First page"
            }
            Button {
                text: "Test"
                horizontalAlignment: HorizontalAlignment.Fill
                verticalAlignment: VerticalAlignment.Fill
                onClicked: {
                    page.destroy();
                }
            }
        }
    }
}

 

someone has to solve this problem?

 

Gratefull,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

__
Helped you? Like me.
Please use plain text.
Regular Contributor
_NishantShah
Posts: 76
Registered: ‎07-31-2012
My Device: Blackberry
My Carrier: Vodafone

Re: [Help] Open NavigationPane in other qml

I would suggest you to take NavigationPane on top of application & later push pages.

Still there's a way to do. You can put NavigationPane in a sheet & open it.

 

 

Page{

    attachedObjects: [
      ComponentDefinition {
         id: sheet
         Sheet {
            NavigationPane {
               Page {
                  Label {
                     text: "Navigation Pane"
                  }
               }
            }
         }
      }
   ]

...

...

         onFocusChanged: {
            if (ListItem.active) {

               var newSheet = sheet.createObject()
               newSheet.open()

            }
         }

...

...

...

}

 

Regards,

Nishant Shah

Please use plain text.