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
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel
Accepted Solution

Navigation Between Pages

Hello All,

 

I am developing an app for z10 , i have 4 pages with lots of custom ui controls inside each of them.

 

But i dont have a navigation page, so can somebody help me to find out whats the best way to navigation between the pages ??

 

Regards,

neo

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Navigation Between Pages

usually you have a navigationPane, which is not a visible element but is used to control the navigation (using push/pop etc).

if you don't want to use one (or another pane like tabbedpane) you would have to control the UI from c++
----------------------------------------------------------
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
Regular Contributor
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Re: Navigation Between Pages

Hello simon_hain

Thanks a lot for your reply, can you give me some example how can i do it from c++ ??

Regards,neo
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Navigation Between Pages

you use bb::cascades::Application setScene to set the current scene, which takes an AbstractPane. Page is an AbstractPane so you can call setScene with each page to set it.
----------------------------------------------------------
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
Developer
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Navigation Between Pages

@coolneo,

 

you can simply connect your buttons or whatever it is to their respective slots with the following code in them:

 

void ApplicationUI::onButton1Clicked()
{
  Application::instance()->setScene(page1);
}

 that will be the code for loading a page page1 when a button button1 is clicked. Use the same template for other pages and buttons. However, if I were you, I would prefer a NavigationPane; it's easier to implement. Smiley Happy