{ "id": "176136", "key": "TIMOB-28404", "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": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-04-05T14:51:22.000+0000", "created": "2021-03-24T14:33:50.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "21201", "description": "", "name": "Release 10.1.0", "archived": false, "released": true, "releaseDate": "2021-09-28" }, { "id": "21050", "name": "Release 10.0.0", "archived": false, "released": true, "releaseDate": "2021-05-17" } ], "issuelinks": [ { "id": "59250", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "176139", "key": "TIMOB-28407", "fields": { "summary": "Review possible incorrectly documented setter/getter functions", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-04-12T22:15:20.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": "When running the code below the following error is shown, the docs state that setActiveTab() should also work on iOS and not just on Android. \r\n\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TabGroup-method-setActiveTab \r\n \r\nhttps://github.com/appcelerator/titanium_mobile/blob/f6408505023dd85a4b13857130e0ef31289cc870/apidoc/Titanium/UI/TabGroup.yml#L271-L276\r\n\r\n*Error:*\r\n{code:java}\r\n[ERROR] \b\b \bfile:///app.js:26\r\n[ERROR] \b\b \b(null)\r\n[ERROR] \b\b \b ^\r\n[ERROR] \b\b \bTypeError: tabGroup.setActiveTab is not a function. (In 'tabGroup.setActiveTab(1)', 'tabGroup.setActiveTab' is undefined)\r\n[ERROR] \b\b \b at Object. (file:///app.js:26:24)\r\n[ERROR] \b\b \b\r\n[ERROR] \b\b \b Foundation 0x00007fff2084c37a _NSDescriptionWithLocaleFunc + 82\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bae0d __CFStringAppendFormatCore + 12102\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bc8a1 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 145\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bc80a _CFStringCreateWithFormatAndArgumentsAux2 + 20\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100608f4a TiLogMessage + 175\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100645f08 -[TiExceptionHandler reportScriptError:] + 74\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100632dae TiBindingEventProcess + 731\r\n[ERROR] \b\b \b TitaniumKit 0x000000010065427b -[KrollContext invoke:] + 109\r\n[ERROR] \b\b \b TitaniumKit 0x00000001006542ee -[KrollContext enqueue:] + 93\r\n[ERROR] \b\b \b TitaniumKit 0x000000010065b6d0 TiBindingRunLoopEnqueue + 77\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100632e35 TiBindingEventProcess + 866\r\n[ERROR] \b\b \b TitaniumKit 0x000000010065427b -[KrollContext invoke:] + 109\r\n[ERROR] \b\b \b TitaniumKit 0x00000001006542ee -[KrollContext enqueue:] + 93\r\n[ERROR] \b\b \b TitaniumKit 0x000000010065b6d0 TiBindingRunLoopEnqueue + 77\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100659dd5 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 187\r\n[ERROR] \b\b \b TitaniumKit 0x000000010063ab5f -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\r\n[ERROR] \b\b \b TitaniumKit 0x0000000100659bcb -[TiProxy fireEvent:withObject:propagate:] + 76\r\n[ERROR] \b\b \b TitaniumKit 0x000000010062bcb3 -[TiUIView touchesEnded:withEvent:] + 110\r\n{code}\r\n\r\n*Test Case:*\r\n{code:java}\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor: 'blue',\r\n title: 'Blue'\r\n});\r\nwin1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'red',\r\n title: 'Red'\r\n});\r\nwin2.add(Ti.UI.createLabel({text: 'I am a red window.'}));\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n window: win1,\r\n title: 'Blue'\r\n}),\r\ntab2 = Ti.UI.createTab({\r\n window: win2,\r\n title: 'Red'\r\n}),\r\ntabGroup = Ti.UI.createTabGroup({\r\n tabs: [tab1, tab2]\r\n});\r\n\r\nwin1.addEventListener('click', () => {\r\n tabGroup.setActiveTab(1);\r\n})\r\ntabGroup.open();\r\n{code}\r\n\r\n*text.setSelection()*\r\n*code*\r\n{code:java}\r\nvar text = Ti.UI.createTextField({top: 100, value: \"This is Sparta.\"});\r\n//var text = Ti.UI.createTextArea({top: 100, value: \"This is Sparta.\"});\r\n\r\n \r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: \"#fff\"});\r\nvar button = Ti.UI.createButton({bottom: 50, title: \"text selection\"});\r\nbutton.addEventListener('click', function(e) {\r\n text.setSelection(0, 4);\r\n});\r\n\r\n \r\n\r\nwin.add(text);\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n\r\n*Error*\r\n{code:java}\r\n[ERROR] \b\b \bfile:///app.js:8\r\n[ERROR] \b\b \b(null)\r\n[ERROR] \b\b \b ^\r\n[ERROR] \b\b \bTypeError: text.setSelection is not a function. (In 'text.setSelection(0, 4)', 'text.setSelection' is undefined)\r\n[ERROR] \b\b \b at Object. (file:///app.js:8:20)\r\n[ERROR] \b\b \b\r\n[ERROR] \b\b \b Foundation 0x00007fff2084c37a _NSDescriptionWithLocaleFunc + 82\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bae0d __CFStringAppendFormatCore + 12102\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bc8a1 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 145\r\n[ERROR] \b\b \b CoreFoundation 0x00007fff203bc80a _CFStringCreateWithFormatAndArgumentsAux2 + 20\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a00f3d TiLogMessage + 175\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a3def8 -[TiExceptionHandler reportScriptError:] + 74\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a2ad9e TiBindingEventProcess + 731\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a4c26b -[KrollContext invoke:] + 109\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a4c2de -[KrollContext enqueue:] + 93\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a536c0 TiBindingRunLoopEnqueue + 77\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a51dc5 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 187\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a32b4f -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\r\n[ERROR] \b\b \b aneww 0x000000010758ff30 -[TiUIButtonProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 272\r\n[ERROR] \b\b \b TitaniumKit 0x0000000107a51ad9 -[TiProxy fireEvent:withObject:] + 72\r\n[ERROR] \b\b \b aneww 0x0000000107592ade -[TiUIButton controlAction:forEvent:] + 686\r\n[ERROR] \b\b \b UIKitCore 0x00007fff2469d19e -[UIApplication sendAction:to:from:forEvent:] + 83\r\n[ERROR] \b\b \b UIKitCore 0x00007fff23fc6684 -[UIControl sendAction:to:forEvent:] + 223\r\n[ERROR] \b\b \b UIKitCore 0x00007fff23fc69a7 -[UIControl _sendActionsForEvents:withEvent:] + 332\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "iOS: tabGroup.setActiveTab() and text.setSelection() shows an error ", "creator": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MacOS Big Sur: 11.1 Beta 1\r\nXcode: 12.2 Beta\r\nJava Version: 1.8.0_242\r\nAndroid NDK: 21.3.6528147\r\nNode.js: 12.18.1\r\n\"\"NPM\":\"5.0.0\",\"CLI\":\"8.1.1\"\"\r\niPhone 8 14.2", "comment": { "comments": [ { "id": "458479", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR - https://github.com/appcelerator/titanium_mobile/pull/12654\r\n\r\nNote -\r\n1. setSelection (textfield)- Fixed in code as this is issue\r\n\r\n{code:java}\r\n//var text = Ti.UI.createTextField({top: 100, value: \"This is Sparta.\"});\r\nvar text = Ti.UI.createTextArea({top: 100, value: \"This is Sparta.\"});\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: \"#fff\"});\r\nvar button = Ti.UI.createButton({bottom: 50, title: \"text selection\"});\r\nbutton.addEventListener('click', function(e) {\r\n text.setSelection(0, 4);\r\n setTimeout(function(e) {\r\n Ti.API.info(text.selection.length);\r\n Ti.API.info(text.selection.location);\t\r\n}, 1000);\r\n});\r\n\r\nwin.add(text);\r\nwin.add(button);\r\nwin.open();\r\n{code}\r\n\r\n2. setTabSelection (tabgroup) - This is property. So updated doc and it should be used as tabGroup.tabSelection\r\n\r\n\r\n{code:java}\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor: 'blue',\r\n title: 'Blue'\r\n});\r\nwin1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'red',\r\n title: 'Red'\r\n});\r\nwin2.add(Ti.UI.createLabel({text: 'I am a red window.'}));\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n window: win1,\r\n title: 'Blue'\r\n}),\r\ntab2 = Ti.UI.createTab({\r\n window: win2,\r\n title: 'Red'\r\n}),\r\ntabGroup = Ti.UI.createTabGroup({\r\n tabs: [tab1, tab2]\r\n});\r\n\r\nwin1.addEventListener('click', () => {\r\n tabGroup.activeTab = 1;\r\n})\r\ntabGroup.open();\r\n{code}\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-24T19:43:05.000+0000", "updated": "2021-03-24T19:52:50.000+0000" }, { "id": "458488", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master, backport PR merged on 10_0_X\r\nhttps://github.com/appcelerator/titanium_mobile/pull/12666", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-03-26T15:21:52.000+0000", "updated": "2021-03-29T13:41:41.000+0000" }, { "id": "458489", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Below PR addresses the Android side of this ticket...\r\nPR (master): https://github.com/appcelerator/titanium_mobile/pull/12661", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-03-26T19:23:38.000+0000", "updated": "2021-03-26T19:23:38.000+0000" }, { "id": "458524", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged android PR https://github.com/appcelerator/titanium_mobile/pull/12661 to master, backport to 10_0_X done via manual cherry-pick and conflict resolution.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2021-04-05T14:43:25.000+0000", "updated": "2021-04-05T14:51:18.000+0000" }, { "id": "458563", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Something broke for me in Android 10.1.0 master and the example from https://github.com/appcelerator/titanium_mobile/pull/12693 is not working for me either\r\n\r\n\r\n{noformat}\r\n[ERROR] TabGroupProxy: (main) [72,72] Invalid tab index.\r\n[ERROR] TabGroupProxy: (main) [18,278] Cannot activate tab not in this group.\r\n{noformat}\r\n\r\n\r\nand the tabs are empty.\r\n\r\n\r\nIn my app where I assign icons in my controller:\r\n\r\n\r\n{code:java}\r\n$.tab1.icon=Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,\"icon_list.png\").read()\r\n{code}\r\n\r\n\r\nI'll end up with:\r\n\r\n\r\n\r\n{noformat}\r\n[ERROR] TiExceptionHandler: $.tab1.icon=Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,\"icon_list.png\").read(),\r\n[ERROR] TiExceptionHandler: ^\r\n[ERROR] TiExceptionHandler: Error: Windows are created during open\r\n{noformat}\r\n\r\n\r\n\r\nIf I go back to https://github.com/appcelerator/titanium_mobile/tree/e128bd9f0017cb90ba13729b7d6ee7f25f7af786 it works fine again", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2021-04-12T18:15:26.000+0000", "updated": "2021-04-12T18:15:26.000+0000" }, { "id": "458565", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~michael], I'm able to reproduce the crash. I've written up a separate ticket here: [TIMOB-28418]\r\nThanks for brining this up.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-04-12T22:15:20.000+0000", "updated": "2021-04-12T22:15:20.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }