Hello, i am trying to make goBack and GoForward buttons for my webview, but nothing happens? Where is my mistake?
var myWin = Ti.UI.createWindow({ title:'', barColor:barcolor_ui }); var myAdress = Ti.UI.createWebView({ url:e.source.link, bottom:50 }); myWin.add(myAdress); var closeBTN = Ti.UI.createButton({ title:'Close' }); closeBTN.addEventListener("click",function(e){ myWin.close(); }); myWin.setLeftNavButton(closeBTN); var safari = Ti.UI.createButton({ title:'Open at Safari' }); safari.addEventListener("click",function(e){ Ti.Platform.openURL(myAdress.url); Ti.API.info("URL to GO:"+myAdress.url); }); var flexSpace = Ti.UI.createButton({ systemButton : Ti.UI.iPhone.SystemButton.FLEXIBLE_SPACE }); var leftButton = Ti.UI.createButton({ image : 'images/icon_arrow_left.png' }); leftButton.addEventListener('click', function() { myAdress.goBack(); }); var rightButton = Ti.UI.createButton({ image : 'images/icon_arrow_right.png' }); rightButton.addEventListener('click', function() { }); var toolbar = Ti.UI.iOS.createToolbar({ items : [ flexSpace, leftButton, flexSpace, rightButton, flexSpace ], bottom : 0, borderTop : true, borderBottom : true, //barImage:barimage_ui, backgroundImage:background_ui, barColor : barcolor_ui }); myWin.add(toolbar); myWin.setRightNavButton(safari); myWin.open({modal:true});
1 Answer
Accepted Answer
Hi Gurkan,
I think you forgot to write goForward() function in your right button.
rightButton.addEventListener('click', function() { myAdress.goForward(); });
Your Answer
Think you can help? Login to answer this question!