blackberry / WebWorks

BlackBerry WebWorks for Smartphones is a platform for building deeply integrated web applications for BlackBerry smartphones
http://developer.blackberry.com/html5
268 stars 51 forks source link

Back Button issues on BB6 #56

Closed tneil closed 12 years ago

tneil commented 12 years ago

There seems to be a bunch of inconsistencies with the hardware back button and how it reacts in BrowserField. There are issues where it doesn't recognize navigation through anchor tags as well as not being able to work properly if someone sets the location.href through JavaScript

Some early tests show that if we were to actually call javascript history.back() instead of calling the back method on BrowserField that it resolves some of these issues.

This doesn't seem to be a problem on BB5.

tohman commented 12 years ago

The issue can’t be eliminated because its root is in BrowserField to where the call to go back in history is delegated. The issue appears when redirecting pages using location.href. The issue wasn't experienced when Anchor was used for page redirection.

Because location.href in BB6 doesn't cause the new entry to the browser history, use Anchor instead to eliminate the issue, or alternatively trap the back button in JavaScript and call history.back() (history.back might not work on all devices).

kwallis commented 12 years ago

We can't use history.back() in the template code?

tohman commented 12 years ago

If we use that then the BrowserFieldHistory would be out of sync, and won't be able to identify always correct if there is still pages to go back or to close the app when there is no pages in the history.

kwallis commented 12 years ago

Tim, any additional thoughts before we close this issue?

----- Original Message ----- From: Sergey Golod [mailto:reply@reply.github.com] Sent: Wednesday, February 01, 2012 12:52 PM To: Ken Wallis Subject: Re: [WebWorks] Back Button issues on BB6 (#56)

If we use that then the BrowserFieldHistory would be out of sync, and won't be able to identify always correct if there is still pages to go back or to close the app when there is no pages in the history.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/WebWorks/issues/56#issuecomment-3763516


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

tneil commented 12 years ago

So if you do a history.back() in JavaScript it doesn't update the BrowserField history?

tohman commented 12 years ago

It doesn't. If I move forward 4 times from page 1 to page 5 and 2 backward with history.back that brings me to page 3, then calling to goBack() method on BrowserFieldHistory would bring me to page 4 (down from 5) and next call to history.back() would bring me to page 3 again.