{ "id": "81606", "key": "TIMOB-5824", "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": "13502", "description": "Sprint 2012-14 Core", "name": "Sprint 2012-14 Core", "archived": true, "released": true, "releaseDate": "2012-07-15" }, { "id": "13572", "description": "Release 2.1.1", "name": "Release 2.1.1", "archived": true, "released": true, "releaseDate": "2012-07-31" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-07-26T09:53:38.000+0000", "created": "2011-10-14T08:37:20.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "core", "module_webview", "qe-testadded" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [ { "id": "18917", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "61607", "key": "TIMOB-975", "fields": { "summary": "Webview evalJS() causes an open virtual keyboard to close", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "19712", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "92368", "key": "TIMOB-9269", "fields": { "summary": "Android: UI suite in drillbit intermittently failing on webviewBindingUnavailable test ( 2.2 V8 Emulator only)", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "19713", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "97404", "key": "TIMOB-9977", "fields": { "summary": "Android: Anvil: ui/ui/webview* tests fail", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-12-03T21:47:55.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": "h4. Problem Description\r\nI'm using the WebView's evalJS function in a setInterval() to act as a bridge between Titanium and a web app from a remote web server. However, form fields in the web app on Android do not work -- I can tap into the form field, but the keyboard never comes up, or if it does, it disappears immediately.\r\n\r\nh4. Actual Results\r\nThe keyboard never comes up, with an error like this:\r\n\r\nERROR: Error: Only the original thread that created a view hierarchy can touch its views.\r\n\r\n\r\nh4. Expected Results\r\nThe keyboard working just fine. \r\n\r\n\r\nh4. Test Case\r\n1. Create new mobile project\r\n2. Drop the following in app.js and run it on a simulator or actual device. Tap into the Google search box, and the keyboard may briefly appear before disappearing; either way you won't be able to type into the box.\r\n{code}\r\nvar window = Titanium.UI.createWindow({\r\n title: \"WebView.evalJS Focus Problem!\"\r\n});\r\n\r\nvar webViewOptions = {\r\n url: \"http://www.google.com\"\r\n};\r\n\r\nvar webView = Ti.UI.createWebView(webViewOptions);\r\nwebView.addEventListener(\"load\", function(e) {\r\n\tsetInterval(doSomething, 1000);\r\n});\r\n\r\nwindow.add(webView);\r\nwindow.open();\r\n\r\nfunction doSomething() {\r\n\ttry {\r\n\t\tvar result = webView.evalJS(\"doSomethingOnTheWebView();\");\r\n\t}\r\n\tcatch(e) {\r\n\t\tTi.API.info(\"\\n\\n\\n\\nERROR: \" + e);\r\n\t}\r\n}\r\n{code}\r\n\r\nh4. Extra info \r\n\r\nI have noticed that removing the try/catch block in the \"doSomething\" method causes the entire app to crash with a Java error, something about \"JavaException: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.\" To get around that error, I tried creating the WebView in the doSomething() method so that the WebView was created in the same thread in which it was used. This seemed to fix the error in the example given above, but in the app I'm building (which I unfortunately can't share in this public setting) the input boxes still lost focus. \r\n\r\nThis same problem was reported on the Q&A several months ago, with no apparent resolution:\r\n\r\nhttp://developer.appcelerator.com/question/119845/using-webviewevaljs-and-lost-focus-android#comment-100385\r\n\r\nI should add that the \"lost focus\" problem does not appear on the iOS simulator, using the app.js listed here.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: WebView.evalJS Causes Form Input Fields to Lost/Not Retain Focus", "creator": { "name": "ryan@asleson.net", "key": "ryan@asleson.net", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "ryan@asleson.net", "key": "ryan@asleson.net", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Chicago" }, "environment": "Titanium SDK version: 1.7.3, 1.8CI, 2.1.0 (06/12/12 17:02 40ba370)\r\nJavascript Engine: V8 \r\nPlatform & version: Android 2.3.4 \r\nDevice Details: Android emulator, Motorola Droid 2.2.2, HTC Droid Incredible 2.2, Evo 4G 2.3.3\r\nHost Operating System: OSX 10.7.3\r\n", "comment": { "comments": [ { "id": "169911", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you for raising this ticket. I am afraid we need all the information listed in the [Jira Ticket Checklist|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist] in order to accept a ticket. In this case, we need more detailed environment info.\r\n\r\nOnce this ticket is complete, we can move it to the main project.\r\n\r\nThank you", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T13:34:28.000+0000", "updated": "2011-10-20T13:34:28.000+0000" }, { "id": "169912", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also, could you test this in 1.7.3 as well?\r\n\r\nThanks,\r\nMatt", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T13:35:10.000+0000", "updated": "2011-10-20T13:35:10.000+0000" }, { "id": "170019", "author": { "name": "ryan@asleson.net", "key": "ryan@asleson.net", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Chicago" }, "body": "OK, I have updated the environment information so I think it's all complete. How do I reopen the bug or otherwise notify somebody that it's complete and can be looked at again?", "updateAuthor": { "name": "ryan@asleson.net", "key": "ryan@asleson.net", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Chicago" }, "created": "2011-10-21T06:02:18.000+0000", "updated": "2011-10-21T06:02:18.000+0000" }, { "id": "200429", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated test case:\r\n\r\napp.js:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#ccc'\r\n});\r\n \r\nvar webView = Ti.UI.createWebView({ url: \"test.html\" });\r\n\r\nwebView.addEventListener(\"load\", function() {\r\n\tTi.API.info(\"webView loaded\");\r\n\tsetInterval(doSomething, 1000);\r\n});\r\n \r\nwin.add(webView);\r\n \r\nwin.open();\r\n\r\n\r\nfunction doSomething() {\r\n\tTi.API.info(\"interval triggered\");\r\n\ttry {\r\n\t\tvar result = webView.evalJS(\"getEvents();\");\r\n\t\tTi.API.info(\"RESULT: \" + result);\r\n\t} catch(e) {\r\n\t\tTi.API.info(\"ERROR: \" + e);\r\n\t}\r\n}\r\n{code}\r\n\r\ntest.html:\r\n{code}\r\n\r\n\r\n\r\n blubb \r\n\r\n\r\n\r\n \r\n\r\n\r\n{code}", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-26T15:33:12.000+0000", "updated": "2012-06-26T15:33:12.000+0000" }, { "id": "202785", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR ready: https://github.com/appcelerator/titanium_mobile/pull/2540", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-11T16:16:46.000+0000", "updated": "2012-07-11T16:16:46.000+0000" }, { "id": "203190", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR for 2_1_X merged\r\nhttps://github.com/appcelerator/titanium_mobile/pull/2558", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-13T13:55:10.000+0000", "updated": "2012-07-13T13:55:10.000+0000" }, { "id": "208001", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on:\r\nTitanium Studio: 2.1.1.201207161421\r\nTitanium SDK: 2.1.1.v2012071618060\r\nAndroid Device: LGP970 (V2.2), Samsung Galaxy Note (V2.3.6)\r\nJavascript Engine: V8", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-17T04:00:10.000+0000", "updated": "2012-07-17T04:00:10.000+0000" }, { "id": "213093", "author": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on \r\nTitanium SDK: 2.0.3.v20120806151610\r\nAndroid Device: LGP970 (V2.2), Samsung Galaxy Nexus (V4.0.2)\r\nJavascript Engine: V8", "updateAuthor": { "name": "ssekhri", "key": "ssekhri", "displayName": "Satyam Sekhri", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-07T05:10:11.000+0000", "updated": "2012-08-07T05:10:11.000+0000" }, { "id": "263373", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening just to update label.\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T09:44:54.000+0000", "updated": "2013-07-26T09:44:54.000+0000" }, { "id": "263376", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated label.\r\nClosing as Fixed.\r\n\r\nVerified with:\r\n\r\nStudio: 3.1.1.201306131423\r\nSDK: 3.1.2.v20130725180746\r\nacs:1.0.3\r\nalloy:1.1.3\r\nnpm:1.2.14\r\ntitanium:3.1.1\r\ntitanium-code-processor:1.0.1\r\nOS: OSX 10.8\r\nDevice: HTC Desire(v4.0.3)\r\n\r\nForm Input Fields working fine with WebView.evalJS\r\n", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-26T09:53:38.000+0000", "updated": "2013-07-26T09:53:38.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }