We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2015-12-12 23:33:44 +0200

ApB gravatar image

Adventures in pageStack.

On the FirstPage we have a list of things. On the Create page we create an item to the list and do a pageStack.replace(firstpage) so that it "reloads" the firstpage (which has a function for filling the list) adds the new item on the list and display the updated first page. All nice up to here.

However this approach leaves -if you swipe back- a non updated First page. Trying to pop the non updated first page didn't seem to work. Using pop from the create page doesn't update the first page.

Is there a way to remove the non updated first page from the list?

Adventures Updating pages in pageStack.the pageStack

On the FirstPage we have a list of things. On the Create page we create an item to the list and do a pageStack.replace(firstpage) so that it "reloads" the firstpage (which has a function for filling the list) adds the new item on the list and display the updated first page. All nice up to here.

However this approach leaves -if you swipe back- a non updated First page. Trying to pop the non updated first page didn't seem to work. Using pop from the create page doesn't update the first page.

Is there a way to remove the non updated first page from the list?

Updated the title to reflect the problem/discussion (see comments).

Updating pages in the pageStack

On the FirstPage we have a list of things. On the Create page we create an item to the list and do a pageStack.replace(firstpage) so that it "reloads" the firstpage (which has a function for filling the list) adds the new item on the list and display the updated first page. All nice up to here.

However this approach leaves -if you swipe back- a non updated First page. Trying to pop the non updated first page didn't seem to work. Using pop from the create page doesn't update the first page.

Is there a way to remove the non updated first page from the list?

Updated the title to reflect the problem/discussion (see comments).

Edit 2: Somehow solved but there must be a more correct/better way.

if i change Component.onCompleted: { } on the first page with onStatusChanged: { } it updates the list however it breaks the model i pass to the edit dialog. Also it seems to call the functions in onStatusChanged more than it is necessary and seems kind of wasteful.

:/