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
contryboy
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha
Accepted Solution

A page cannot be pushed to two navigationPane?

Hi There,

 

Say I have two navigationPane that are put into two tabs, say, navPane1, navPane2; Then I have a page, say, myPage. All are c++ objects that load qml files. Now what I want is to push the single myPage object into navPane1, then pop up, then push it to navPane2. Or in other order.

What I observed is that if I push it to navPane1 first, then pop up, push it to navPane2, the UI will not be show on the phone. But it can be pushed and poped up in navPane1 without any problem. The same happens if I pushe it to navPane2 first.

 

So it seems to me that once a page is pushed to a navPane, it can only be pushed into the same navPane later. It would not work if you want to push it to another navPane.

 

Is that true?

 

Thanks,

Dong

Developer
markwilcox
Posts: 51
Registered: ‎11-23-2012
My Device: BB10 Dev Alpha

Re: A page cannot be pushed to two navigationPane?

It makes sense that you would not be able to push the exact same page object onto two different navigation panes.  You should be able to push two separate instances of the same page onto two different navigation panes... does that fit your use case?

 

If not, I think you should look at the navigation structure of the app anyway - being able to navigate to the exact same screen in two different tabs seems a bit broken and confusing.  Consider switching tabs automatically, or using a Sheet.

 

Developer
contryboy
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha

Re: A page cannot be pushed to two navigationPane?

I think you are right.

Developer
contryboy
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha

Re: A page cannot be pushed to two navigationPane?

Actually I just noticed it from documentation, that once it is pushed to a navigation pane, that navigation pane owns the page. If you want to push it to another navigation pane, you need to reset the page's parent.
Developer
steve8820
Posts: 78
Registered: ‎04-04-2013
My Device: BB10 Dev Alpha Simulator

Re: A page cannot be pushed to two navigationPane?

May i know how did you reset the parent?

Regards,

Steve Chan
Developer
contryboy
Posts: 68
Registered: ‎08-16-2012
My Device: BB10 Dev Alpha

Re: A page cannot be pushed to two navigationPane?

Yes, just call page.setParent(NULL).