Hi all

This morning I found that if a page element is repeatedly pushed to the PageStack, repeated instances of the page are created on the PageStack, as shown by the breadcrumb indicators on the top of the page(s).

So why try and repush a page?

What I really wanted to do was to pop back to the previous page, but pass some information back to the previous page. As the pop() method does not allow properties to be set, but push() does, I had misused push(). On Harmattan this worked well enough (or rather if it was adding multiple page instances, I did not see it due to the lack of breadcrumbs).

Looking closer at the code of the app where I found the problem I discovered that for another page wanting to pass info back I had taken a different approach. Here I had used pop() but before calling pop() I had directly passed info to the previous page by setting properties of that page.

Both approaches are shown in this mini-throwaway demo.

https://github.com/sailfishapps/ThrowawayDemos/tree/master/Kaputt/PageHandling

To my mind the cleanest solution would be if Sailfish supported:

pop(page, properties, operationType)

Cheers

Chris

_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to