{ "id": "61523", "key": "TIMOB-891", "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": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:35.000+0000", "created": "2011-04-15T02:38:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:35.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
Implement window focus/blur
This is crucial to how my apps work when users change tabs.\nSince a few of the tabs use the same code in different contexts -\neg: twitter timelines for friends, mentions, favorites etc. I\nsuppose I could code around it for now and use copies of various\nscripts.
\nAny idea when this might get addressed?
\nIt's a bit of a showstopper.
@kosso can you paste a boiled down use case for you app? we'd\nlike to get this fixed
Hi,
\nTry this: http://pastie.org/1035404
\nIt contains the JS required for app.js and test.js - for a\nsimple test
\nThe use case for this is for (example) a Twitter client, where\neach tab is used for the list of tweets.
\nThey all the use same functions based in app.js but with differnt\ncontexts and 'request_type' (eg: friends, mentions, favorites,\netc.) - The API requests and all the tableView building all uses\nfunctions in app.js too.
It seems that Ti on Android does not support the Window focus\nevent which I use to see if the user has changed tab (and if it\nneeds to request more data etc) and also it seems that it also does\nnot support the ability for me to attach the name of the function\nin app.js as a window property when I build it - which works fine\nin iOS.
\nHope this helps! ;)
\nK
Hi
\nThe window focus and blur events are crucial for us!
\nWe use the window blur event to cancel pending asynchronous HTTP\nrequests that we don't wish to continue when the user selects\nanother tab bar option, for example.
\nThanks
\nJon
Hi,
\nI just noticed that it does not work in 1.3.2, too. We want to\nuse the 'blur' to open a specific window cause we do not want to\ndisplay the previous opened window when the user presses the back\nbutton.
\nHope this will be fixed/implemented soon.
\nThanks
(from [17c619b957a9ace9c405b4e2ebc61dddbcd15b22])\n[#891\nstate:resolved] Fake fired after context loaded, fire during\nonStart if the proxy is available for focus. Fire in onStop if\nthere is a proxy for blur. \nhttp://github.com/appcelerator/titanium_mobile/commit/17c619b957a9a...
This issue is still broken in 1.6.1
\nTried the same code as copied from http://pastie.org/1035404.
\nThis is the output when switching between the windows.
[INFO] Deployed testing ... Application\nshould be running. [INFO] [18,725] this is test.js :\nrequest_type:test_one [INFO] [17,47175] this is test.js :\nrequest_type:test_two
\nTesting on android emulator