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
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone
Accepted Solution

Sharing single navigation pane by all tabs.

hello all,

    

    i have a tab pane in my application, Right now i have 4 navigation panes for 4 tabs. 

is it possible that all my 4 tabs share the same navigation pane??

 

Please reply!

Thanks.

Please use plain text.
Developer
simon_hain
Posts: 16,042
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Sharing single navigation pane by all tabs.

[ Edited ]

edit: see below

----------------------------------------------------------
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
Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Sharing single navigation pane by all tabs.

[ Edited ]

Hate to go against Simon but of course it's possible. If your intention is to use your Tabs as a kind of filter then there is no reason you can't show the same NavigationPane for each Tab.

 

TabbedPane {
    showTabsOnActionBar: false
    Tab {
        NavigationPane {
            Page {
            	Label {
            	    id: navLabel
                	    text: "Filter 1" 
                  } 
            }            
        }
    }
    Tab {
        title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
        onTriggered: navLabel.text = "Filter 2"
    }
    Tab {
        title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
        onTriggered: navLabel.text = "Filter 3"
    }
}

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Sharing single navigation pane by all tabs.

BBSJdev i tried your suggestion, it does work, but in my case i need to push pages on the navigation pane.

like if i m on tab 3 right now, and i push a page on the navigation pane, the pushed page is not immidately visible to me, because it has been actually pushed on the nav pane of tab 1.

if i manully go to tab 1, only then the pushed page will become visible to me.

i do not expect this.

the page pushed irrespective of the tab, should be immidatly visible to me.

 

Please do reply!

Regards :smileyhappy:

Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Sharing single navigation pane by all tabs.

That was just an example to get you started, from that you could see how you can access the navigationPane from any Tab action.
So instead of updating the navLabel in the onTriggered instead you would push your different page.

If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Sharing single navigation pane by all tabs.

yes i did try that.. but like i said, if i pushed a page from tab 3, its not visible immidately..

we can see this pushed page only if we go to tab 1 manually!

any work around for this?

Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Sharing single navigation pane by all tabs.

Well I don;t know what you did in your code but it works for me...

 

TabbedPane {
    showTabsOnActionBar: false
    Tab {
        title: qsTr("Home") + Retranslate.onLocaleOrLanguageChanged
        NavigationPane {
            id: navPane
            Page {
            	Label {
                      id: navLabel
                	    text: "Filter 1" 
                  } 
            }
        	
            onPopTransitionEnded: {
            	page.destroy();
            }
        }
    }
    Tab {
        title: qsTr("Tab 2") + Retranslate.onLocaleOrLanguageChanged
        onTriggered: {
            navLabel.text = "Filter 2";
            var page = page2.createObject();
            navPane.push(page);
        }
    }
    Tab {
        title: qsTr("Tab 3") + Retranslate.onLocaleOrLanguageChanged
        onTriggered: {
            navLabel.text = "Filter 3";
            var page = page3.createObject();
            navPane.push(page);
        }
    }

    attachedObjects: [
        ComponentDefinition {
            id: page2
            source: "Label2.qml"
        },
        ComponentDefinition {
            id: page3
            source: "Label3.qml"
        }
    ]
}

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Sharing single navigation pane by all tabs.

@BBSJdev You have implemented onTriggered signal its bound to work sir!

my use case if, i'm on tab 3, there is a button on the same, on click of this button i'm pushing a page on nav page (in tab 1).. so unless i goto tab 1, its not visible on tab 3.

is there anything i can do for this?

Please use plain text.
Developer
BBSJdev
Posts: 6,090
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Sharing single navigation pane by all tabs.

I'm finding it hard to understand what your problem is, your initial OP asked for a navigationPane that can be shared amongst Tabs, you then asked for the ability to push Pages from the other Tabs and I provided code for that.

 

Please close this thread off as the OP has been answered and start a new thread with the code you have so far in it with a clearer explanation of what you are trying to achieve.

 

Thanks.

 


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.