After the user migrates away from the Default Web Page to a distant target page, and then tries to refresh the target page by clicking the browsers refresh (reload) button, the WebApp, instead, always returns the user to the Default page.
I have tried to find an Event in the App or Session where I can trap the activity of the browser’s refresh button, and simply reload the content the user was viewing, but to no avail.
Nearly all of the projects in the Examples folder are single WebPage apps, so I could not find an example to learn from.
i can say you that in all events the hashtag seems to be empty if you moved to another page and go back… i presume that’s a bug since there is a hashtag given in the url?
after returning from google back to the session
Xojo will give you an empty Session.HashTag (or Self.HashTag) so i guess xojo has no such feature, call it a bug but it’s probably again by design…
I was just attempting to understand how to do this from the documentation. Seemed like it wasn’t straight forward or wasn’t working. I gave up there, I can only spend so much time on debugging Xojo Web basics.
I have an implementation where I do perform operations based on the hashtag, and I use Session.Open to check the HashTag property of the Session instance when setting up to forward to the correct page:
Sub Opening() Handles Opening
if me.HashTag.Length > 0 then
select case me.HashTag
case "billing"
System.DebugLog( "Loading Billing portal" )
...
case "support"
System.DebugLog( "Loading Support portal" )
...
end select
end if
End Sub
Any other time that HashTagChanged fires, it will also navigate to a new matching page.
Sub HashTagChanged(Name as String, Data as String) Handles HashTagChanged
select case Name
case "billing"
System.DebugLog( "Loading Billing portal" )
...
case "support"
System.DebugLog( "Loading Support portal" )
...
end select
End Sub
My tests didnt paste my “#” into the url, but even with the “#” the event’s wont raise using “#hello” the hashtag is always removed from the url when the page is returned back.
I see what you’re saying. When navigating back in the browser, after going to another page, the hashtag is removed. From reading on SO, this may be an issue with Modernizr and should be filed in Feedback.
What you are talking about is Session restoration, this was announced as a Web 2.0 feature, BUT it was not implemented.
So, almost 2 years after the las web 1.0 release, web 2.0 is still feature incomplete:
All that HashTag changes and WebSession.SaveState could be used as a work around if you implement manually a system to save all the controls states, page variables, etc to restore them manually when the page refreshes (xojo opens first page, you read the states, load the las visited page and restore all the values to the page)
Ivan:
Unfortunately, the user is me…as I repeatedly test functionality of controls etc. by hitting the Refresh button. That is the frustration…each time I end up back at the Default Web Page and have to drill back down to where I was working…
The Apple HIGs warn against programming strategies that force a ‘context switch’ on the user without their expectation…and now I see what that recommendatation is based on.
Seems to me that the framework should offer a ‘Reload Page’ event in the Session, where we can also destruct and reinstantiate what the page needs…but just my humble suggestion…