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
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
My Carrier: NA
Accepted Solution

inserting and removing pages hides nav bar

My app has a 'bottom' page that has a menu page pushed on top.

 

Menu Page:

m_menuPage = new Page();
ActionItem* backAction = ActionItem::create();
connect(backAction, SIGNAL(triggered()), m_navPane, SLOT(pop()));
m_menuPage->setPaneProperties(NavigationPaneProperties::create().backButton(backAction));
m_menuPage->setContent(m_menuView) //  a custom control

 I then push the start page:

m_navPane->push(m_startPage);

Later I push the menu page:

m_navPane->push(m_menuPage);

Then I want to swap the start page:

m_navPane->insert(-1, m_nextPage);
m_navPane->remove(m_startPage);

 Then the back button & nav bar disappear from the bottom.  What's up?  I thought the back button was associated with the menu page?

 

 

 

 

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: inserting and removing pages hides nav bar

Might be a bug. Try inserting the new page at index 1 then deleting the page at index 0.

If it still disappears, try commenting out "remove" - will it return to newly inserted page properly?

 


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 194
Registered: ‎11-24-2012
My Device: Dev Alpha B, Bold 9700
My Carrier: NA

Re: inserting and removing pages hides nav bar

Inserting at index 1 works.  According to the docs here:

 

https://developer.blackberry.com/cascades/reference/bb__cascades__navigationpane.html#insert

 

Setting to -1 should work.

 

Thanks again.

Developer
Posts: 30
Registered: ‎11-06-2012
My Device: BB 10 Dev Alpha
My Carrier: MegaFon

Re: inserting and removing pages hides nav bar

I'll just notice that there is no need to provide your own action item for the "Back" button unless you want to customize back button title. Default back button works well for me.