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
Highlighted
Developer
Posts: 84
Registered: ‎04-22-2013
My Device: BB 10 Dev
My Carrier: Simulator
Accepted Solution

How to push a new page after pop the current page

Hi all,

Is it possible for me to push a new page after popping the current page?

For example, from main.qml I push page1.qml then push page2.qml and pop page1.qml? (so the one left in the stack are main.qml -> page2.qml)

Any ideas on how can I do this?

Thanks in advance.

 

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

Of course! :-)

 

You can use NavigationPane's remove() function...

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__navigationpane.html#function...


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 84
Registered: ‎04-22-2013
My Device: BB 10 Dev
My Carrier: Simulator

Re: How to push a new page after pop the current page

Not sure why it posted twice, and i can't delete the post. So please ignore this post.
Thank you.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

However think carefully about how confused your user may be if doing this as he/she will expect to go back to one page and instead be returned to another.

 

So either clearly indicate this is going to happen or rethink whether the UI flow can be done another way (i.e. Sheet, dialog).


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

Already answered in this one now I've asked the moderator to remove the first one.


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 84
Registered: ‎04-22-2013
My Device: BB 10 Dev
My Carrier: Simulator

Re: How to push a new page after pop the current page

[ Edited ]

the reason I'm doing this is because from page2.qml I might need to push page1.qml again (which consists of a list view) and hence when I push page1.qml from page2.qml, the list view doesn't load (it just appears empty) unless page1.qml doesn't exist in the stack then the list view loads perfectly. however, I tried using .remove but my listview still doesn't load. any ideas?

 

ListView *listView = Application::instance()->scene()->findChild<ListView *>(
"accSumListView");

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

Another option in this case is to leave the page on the stack and use navigateTo(), I'm not sure why the remove() didn't work for you.

 


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

[ Edited ]

Without looking at your code it's hard to say but in all likelihood the ListView is not in the scene graph when you attempt to access it and load the data. I'm assuming here you are referencing it from C++ using the findChild() method.

 

[Edit] You are, must have skipped that bit in your posting.


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

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: How to push a new page after pop the current page

If this *is* the case then the solution is to wait to update the ListView until you know it is created (using one of the many signals available) rather than trying to work-around it by messing with the navigation stack.

 

If you are unable to come up with a solution from this, please close this thread 'Mark as Solution' as the original question has been answered and open a new one with the new problem, posting your code.

 

 


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

Developer of stokLocker, Sympatico and Super Sentences.