{ "id": "62055", "key": "TIMOB-1423", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11363", "description": "Mobile 1.8.0 M10", "name": "Sprint 2011-31", "archived": true, "released": true, "releaseDate": "2011-08-08" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-05T15:25:17.000+0000", "created": "2011-04-15T02:51:57.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-05T15:25:17.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
Create a tab bar with a couple of tab buttons.
\r\nOne of the tab buttons opens a window. This window opens another\r\nwindow with a back button (in example below from a table view).\r\nClicking on the back button, the original window fires a focus\r\nevent which is fine. However, when the second window is open, if\r\nyou click the tab button again (NOT the back button) to go back to\r\nthe original window, the original window's focus event fires, then\r\nthe blur event, then focus. Only the focus event should fire\r\nonce!
\r\nCode (test2.js doesn't really do anything but is not important\r\nhere)
\r\n// get current window\r\nvar win = Titanium.UI.currentWindow;\r\nvar data = [{title:'row 1'},{title:'row 2'},{title:'row 3'},{ title:'row 4'}];\r\nvar table = Ti.UI.createTableView({data:data, editable:false});
\r\n
\r\n\r\n\r\n
\r\ntable.addEventListener('click', function(e)\r\n{
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n\r\nvar newwin = Titanium.UI.createWindow({\r\n title:'test 2',\r\n backButtonTitle : 'Back',\r\n url:'../scripts/test2.js'\r\n});\r\n\r\n// open the window in the current tab\r\nTitanium.UI.currentWindow.tabGroup.activeTab.open(newwin,{animated:true});
\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n});\r\n\r\n
\r\nwin.addEventListener(\"focus\",function(e) {\r\nTi.API.info('test focus');\r\n\r\n
\r\ntable.data = data;
\r\n
\r\n\r\n\r\n\r\n\r\n
\r\n});\r\n\r\n
\r\nwin.addEventListener(\"blur\",function(e) {\r\nTi.API.info('test blur');\r\n\r\n
\r\ntable.data = [];
\r\n
\r\n\r\n\r\n\r\n
\r\n});\r\n\r\n
\r\nwin.add(table);\r\n
when returning from newwin, is there a way to fire a refresh\nevent on win? I have been trying to do this by calling the \"focus\"\nevent on win, but it only fires the first time win opens. Not when\nreturning from newwin.
\nany ideas?
Preliminary testing indicates this is still valid.
A Helpdesk\ncustomer is having the same problem. I'm just confirming that\nthe bug still exist.
\nThere is also a related problem: tabGroup focus fires three\ntimes when opened. Example code:
\n\nvar tabGroup = Titanium.UI.createTabGroup();\n\nvar win1 = Titanium.UI.createWindow({backgroundColor:'#ccc'});\nvar tab1 = Titanium.UI.createTab({window:win1});\n\nvar win2 = Titanium.UI.createWindow({backgroundColor:'#fff'});\nvar tab2 = Titanium.UI.createTab({window:win2});\n\ntabGroup.addTab(tab1);\ntabGroup.addTab(tab2); \n\ntabGroup.open();\n\ntabGroup.addEventListener('focus', function(e){\n Ti.API.info(e);\n});
\n
\nConsole:
\n\n[INFO] {\n index = \"-1\";\n previousIndex = \"-1\";\n source = \"[object TiUITabGroup]\";\n type = focus;\n}\n[INFO] {\n index = 0;\n previousIndex = \"-1\";\n source = \"[object TiUITabGroup]\";\n tab = \"[object TiUITab]\";\n type = focus;\n}\n[INFO] {\n index = 0;\n previousIndex = \"-1\";\n previousTab = \"<null>\";\n source = \"[object TiUITabGroup]\";\n tab = \"[object TiUITab]\";\n type = focus;\n}
\n
\niPhone Simulator 4.2
\nTi SDK 1.6 RC1