History of my pages / activities is:
Home page (page0).
List of issues (page1).
Detail card of issue (page2).
Popup for confirmation to delete issue (not a page because of JQM popup isn't a page).
When I confirm deletion of issue and delete it, there is no reason to return back to page2 (it's content dropped). The only valid transition here - from popup to list of issues (back twice).
BUT.
When I jump from popup to page1 by $.mobile.changePage, history saves page2 as previous page (because jump was started at page2' popup).
So, when I press back on page1 I expect to return on page0 (rewind history), but returns to page2 which is invalid.
Guess valid behaviour here is:
Jump from popup to page1.
Erase page2 and popup from history at all - or something similar.
How to do it?
Related
I've three pages first showing List of my items on tap I'm redirecting it to a History Page with Object defined with static property with
await Shell.Current.GoToAsync($"/{nameof(DeviceHistoryPage)}");
then from this page i'm again redirecting user to show more details of each history item to next page with data as static property
await Shell.Current.GoToAsync($"/{nameof(DeviceHistoryDetailsPage)}");
I'm able to achieve this navigation and able to move back and forth from first page to second page but from second page once redirected to third page and i'm not able return back to previous page with back button present in navbar
Also I've tried registering routes as independent as well as a child in AppShell as follows
Routing.RegisterRoute($"{nameof(ListPage)}/{nameof(HistoryPage)}", typeof(HistoryPage));
Routing.RegisterRoute($"{nameof(HistoryPage)}/{nameof(HistoryDetailsPage)}", typeof(HistoryDetailsPage));
Hy guys i have just start to develop with Apex 5 i have this problem.
In this page, i have 15 rows, and the other page i have 1 row, but if i press next page, i have this problem.
and i can't go in another page, and if i press ok or cancel the action is the same, the page doesn't refresh.
i print the setting for this page.
Sorry guys but i'm at the begging.
To me, it looks like you should first save changes you've made on this page - otherwise, if you proceed to the next page, those changes will be lost.
If you want to "skip" that warning, navigate to Page properties, scroll down to "Navigation" and turn off "Warn on unsaved changes".
I've got an app with a page xml definition that has a grid-layout with no children. During the page 'loaded' event, I create a bunch of child elements and add them to the grid-layout dynamically.
I navigate to another page and then call frameModule.topmost().goBack() to go back to the previous page.
On that main page, the 'loaded' event gets called again - BUT has the children I already added in the previous navigation - so looks like the page wasn't created again.
Interestingly, if from the same main page, I navigate to another page and then navigate back (i.e. w/o calling goBack()), then the 'loaded' event gets called but the page doesn't have the children I added - so looks like the page was freshly created.
My questions are:
When one calls goBack(), why is 'loaded' called on the previous page - even though it looks like the previously loaded page was being used.
Is this a bug?
Any way to determine in the 'loaded' function - whether this is truly a fresh page loaded or all elements have been created.
The major difference between goBack and Navigate is that goback just goes back up the navigation history stack, and acts the same as if the person hits the "back" button(android) or swipes to the right (iOS). Navigate goes forward and adds a new stack entry that you can goBack on.
Lets look at two examples:
So if I started on Page1 and Navigated to Page2, then Navigated to Page3 then the user hit my "< Back" button and in the code I then Navigated To Page1, my Navigation Stack would look like this:
Page1
Page2
Page3
Page1
If I then use the hardware back button (which triggers) goBack it will be Page3, then Page2, then Page1. The user would probably not expect being on Page1 and hitting the back button to put them on Page3 rather than exiting. So unless you are wanting a weird navigation; this would be normally considered unexpected/broken behavior.
Under proper navigation I might do this:
Page1
Page2 (Not stored in History: used "backstackVisible: false")
Page3
Then a Back from Page3 would actually put me in Page1, and a Back from Page 1 would exit the application. This would be the expected behavior.
Now as to the events.
The events for this page are NavigatingTo, Loaded, NavigatedTo -- they fire in that order.
The loaded event being called is not a bug; it is by design; when the page component is loaded -- it allows you to be able to set up the page element. All components have a "loaded" event. So this is a component level event not a page navigation type event. So for example; I've done this before:
<Switch android:loaded="fixAndroidSwitch"/> and then my fixAndroidSwitch routine fixed up something on the switch.
The NavigatingTo and NavigatedTo are actual Navigation events, and they do have a value passed as part of the argument:
function onNavigatingTo(context) {
if (context.isBackNavigation) { /* Do whatever */ }
}
For more information on page events; you can read my Blog post http://fluentreports.com/blog/?p=191 and it explains more
In my application, I have list of news... When user click on some item, I navigate him to page with detail:
NavigationService.Navigate(new Uri("/Detail.xaml?ID=" + listbox.SelectedIndex, UriKind.Relative));
On this detail page are also button prev and next, which navigate to next and previous items (also to Detail.xaml, just ID is increased or decreased by 1). However, if user go through some news and want to return to "homepage", he needs to push Back button many times. Is there any way, how can I just close this Detail.xaml? Open it modal or something? I don't want to use "go home" button, which just navigate user to main page because of loop when he tries to exit application...
When the next or previous buttons are clicked try calling NavigationService.RemoveBackEntry() in the OnNavigatedTo method. This will remove the page from the back stack, thus ensuring that when they hit the back button they return to the index page.
I have a C#.NET MVC3 web app. I have a View that has a List of Models. This list can be long, requiring the user to scroll down on the View. When selecting one of the models in the View to Edit, the user is taken to the Edit View. After submitting the Edit View, the user is redirected back to the List View. However, the List View is now displaying back at the top of the list. How can I redirect the user back to the same position in the List View where they clicked the Edit button?
You would probably be better suited using a modal popup dialog to edit the data, rather than navigating to another page.
While it's possible to do what you want, it's a pain. You would have to get the scroll location via javascript, save it to a hidden field, post that to your edit page, along with record number and anything else, then re-post it back to your original page when you return, then read the post value and scroll to it via javascript.
All that is avoided if you just use a modal edit dialog, then when the dialog goes away the page is still in the same place.