[AC-4691] Windows: TabGroup createEventListener for "back" or "windows:back" do not work
| GitHub Issue | n/a | 
|---|---|
| Type | Bug | 
| Priority | n/a | 
| Status | Closed | 
| Resolution | Cannot Reproduce | 
| Resolution Date | 2017-01-03T20:51:00.000+0000 | 
| Affected Version/s | n/a | 
| Fix Version/s | n/a | 
| Components | Alloy | 
| Labels | n/a | 
| Reporter | Mitch Starnes | 
| Assignee | Shak Hossain | 
| Created | 2016-12-22T19:34:04.000+0000 | 
| Updated | 2017-01-03T20:51:00.000+0000 | 
Description
	I am currently unable to intercept the back button on a Windows Phone when the current window is based on a TabGroup. The back button kills the app.
Documentation: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup-event-androidback refers to the Windows platform but it doesn't work.
Please add/fix event listening support for TabGroup on the Windows platform.
Hello, Please provide a full sample code to reproduce the issue in our environment. Thanks.
Steps to reproduce:
Build new mobile app based on the "Two-tabbed Alloy Application"
Build and run in a Windows emulator for test purposes
Replace index.js and index.xml with the code shown below.
Build and run and test that tabs still work
Hit the Back button and notice that neither windows:back nor back nor androidback are captured by the listeners in index.js
// index.js $.index.open(); /* Don't let the user back out of the app */ $.index.addEventListener('androidback',function(e) { Ti.API.warn("index androidback"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.index.addEventListener('windows:back',function(e) { Ti.API.warn("index windows:back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.index.addEventListener('back',function(e) { Ti.API.warn("index back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab1.addEventListener('androidback',function(e) { Ti.API.warn("tab1 androidback"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab1.addEventListener('windows:back',function(e) { Ti.API.warn("tab1 windows:back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab1.addEventListener('back',function(e) { Ti.API.warn("tab1 back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab2.addEventListener('androidback',function(e) { Ti.API.warn("tab2 androidback"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab2.addEventListener('windows:back',function(e) { Ti.API.warn("tab2 windows:back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ $.tab2.addEventListener('back',function(e) { Ti.API.warn("tab2 back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ Ti.App.addEventListener('androidback',function(e) { Ti.API.warn("Ti.App androidback"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ Ti.App.addEventListener('windows:back',function(e) { Ti.API.warn("Ti.App windows:back"); e.cancelBubble = true; return false; }); /* Don't let the user back out of the app */ Ti.App.addEventListener('back',function(e) { Ti.API.warn("Ti.App back"); e.cancelBubble = true; return false; });Hello, Thanks for your query. We have tested your issue on our end on following environment and its working for me. *Testing Environment:* Appcelerator Studio, build: 4.8.0.201611121409 SDK: 6.0.1.GA Appcelerator Command-Line Interface, version 6.0.0 Windows emulator: 8.1 WVGA 4 inch 512MB *Testing Code:*
$.tab2.addEventListener('windows:back',function(e) { alert("windows:back Working"); Ti.API.warn("tab2 windows:back"); e.cancelBubble = true; return false; });Still not working for me. Did you follow my instructions to build the project from the "Two-tabbed Alloy Application" sample? If so, our projects should now be identical as I replaced the contents of index.js with this:
$.index.open(); $.tab2.addEventListener('windows:back',function(e) { alert("windows:back Working"); Ti.API.warn("tab2 windows:back"); e.cancelBubble = true; return false; });Is yours an Alloy project? Can I see your index.xml? Can you share your working project in github?
Hello [~mstarnes], Yes, I have tested on Alloy project. I am using VS 2013 Community. I have used your *index.xml* file. *Testing Environment:* Appcelerator Studio, build: 4.8.0.201611121409 SDK: 6.0.1.GA Appcelerator Command-Line Interface, version 6.0.0 Windows emulator: 8.1 WVGA 4 inch 512MB VS 2013 Community Thanks