Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Contributor
Posts: 2
Registered: ‎02-22-2011
My Device: Not Specified

Back button exits WebWorks app

 I have a jQueryMobile site packaged into WebWorks. I'm using the Torch 9800 6.0 simulator. When I use the hardware back button, it exits the application rather than navigating back through the history.

 

When I access the jQueryMobile site in the normal browser, the hardware back button does the right thing.

 

The jQueryMobile team has said this is broken on BB5 but should work on BB6. (link)

 

I've also toggled the config.xml back button checkbox back and forth to no avail.

 

Any suggestions?

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Back button exits WebWorks app

I believe this issue has to do with the plumbing in WebWorks knowing the history of anchor# tags.  You can try overriding the Back button using the blackberry.system API calls and then calling history.back() in javascript.

 

From what I remember, navigating by anchor tags didn't raise an event to the embedded renderer (BrowserField) so that when you ask the renderer to go back, it doesn't have that information in its history.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Highlighted
Contributor
Posts: 19
Registered: ‎06-14-2011
My Device: 9300
My Carrier: Comcel

Re: Back button exits WebWorks app

I know this is old but anyone with the same problem use this:

 

$(document).keypress(function(event) {
	
	
	//alert(event.which);
	if (event.which == '27') {
		event.preventDefault();
		goBack();
	}
	
  
});

function goBack(){
	history.back();
	return false;
}