Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5531] MobileWeb: goBack method closes window if there is no pages in the webView history

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-07T05:20:15.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-07T04:58:37.000+0000
Updated2017-03-09T20:32:21.000+0000

Description

goBack method closes the working window if there is no pages in the webView history. Also the window will close after using goBack method if webView contains the first page of the history of the webView.
var win = Ti.UI.currentWindow;

var tf = Ti.UI.createTextField({
	left: 10,
	top: 5,
	width: 320,
	height: 40
});

var webView = Ti.UI.createWebView({
	top: 50,
	left: 10,
	width: 250,
	height: 300,
//	url: 'google.com/404',
	backgroundColor: '#AAD',
	loading: false,
	touchEnabled: false,
	
});

var but = Ti.UI.createButton({
	left: 400,
	top: 10,
	title: 'canGoBack',
	width: 200,
	height: 50
});

var but2 = Ti.UI.createButton({
	left: 400,
	top: 70,
	title: 'goBack',
	width: 200,
	height: 50
});

win.add(but2);
//win.add(but);
win.add(tf);
win.add(webView);

tf.addEventListener('return',function(){
	webView.url = tf.value;
	});
but2.addEventListener('click', function(){
	webView.goBack();
});

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source