{ "id": "113120", "key": "TIMOB-13758", "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": "15486", "description": "2013 Sprint 10 API", "name": "2013 Sprint 10 API", "archived": true, "released": true, "releaseDate": "2013-05-20" }, { "id": "15108", "description": "2013 Sprint 10", "name": "2013 Sprint 10", "archived": true, "released": true, "releaseDate": "2013-05-20" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-05-15T22:58:02.000+0000", "created": "2013-04-19T11:08:21.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-closed-3.1.1", "qe-testadded" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-06-19T12:42:53.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": "*Problem description*\r\nListView properties are unable to be changed at runtime due to missing super.propertyChanged (see solution below).\r\n\r\n*Steps to reproduce*\r\n1. Run test case on Android\r\n2. Tap the button at the bottom\r\n3. Verify that the top has not visually changed, however the value has\r\n\r\nIf you set the top property to 0 in global scope, the table will be visually updated on launch as expected.\r\n\r\n*Test case*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#FFF\"\r\n})\r\nvar section = Ti.UI.createListSection();\r\nvar table = Ti.UI.createListView({\r\n\tsections : [section],\r\n\ttop : 48\r\n});\r\nwin.add(table);\r\nvar items = [];\r\nfor (var i = 0; i < 10; i++) {\r\n\titems.push({\r\n\t\tproperties : {\r\n\t\t\ttitle : \"Test \" + i\r\n\t\t}\r\n\t});\r\n}\r\nsection.setItems(items);\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttext : \"Test\",\r\n\twidth : 100,\r\n\theight : 44,\r\n\tbottom : 0\r\n});\r\nwin.add(button);\r\n\r\nbutton.addEventListener(\"click\", function() {\r\n\tTi.API.info(\"Table Top Value Before Set: \" + table.top);\r\n\ttable.top = 0;\r\n\tTi.API.info(\"Table Top Value After Set: \" + table.top);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\n*Solution*\r\nIssue is in code of propertyChanged function \r\n{code:java}\r\npublic void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy) {\r\n\r\n\t\tif (key.equals(TiC.PROPERTY_HEADER_TITLE)) {\r\n\t\t\tsetHeaderTitle(TiConvert.toString(newValue));\r\n\t\t} else if (key.equals(TiC.PROPERTY_FOOTER_TITLE)) {\r\n\t\t\tsetFooterTitle(TiConvert.toString(newValue));\r\n\t\t} else if (key.equals(TiC.PROPERTY_SECTIONS) && newValue instanceof Object[] ) {\r\n\t\t\tprocessSections((Object[])newValue);\r\n\t\t\tif (adapter != null) {\r\n\t\t\t\tadapter.notifyDataSetChanged();\r\n\t\t\t}\r\n\t\t} else if (key.equals(TiC.PROPERTY_SHOW_VERTICAL_SCROLL_INDICATOR) && newValue != null) {\r\n\t\t\tlistView.setVerticalScrollBarEnabled(TiConvert.toBoolean(newValue));\r\n\t\t} else if (key.equals(TiC.PROPERTY_DEFAULT_ITEM_TEMPLATE) && newValue != null) {\r\n\t\t\tdefaultTemplateBinding = TiConvert.toString(newValue);\r\n\t\t\trefreshItems();\r\n\t\t} \r\n\t}\r\n{code}\r\n\r\nWhich is missing the following at the bottom:\r\n{code:java}\r\nelse {\r\n super.propertyChanged(key, oldValue, newValue, proxy);\r\n }\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ListView propertyChanged method missed super.propertyChanged", "creator": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "subtasks": [], "reporter": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "environment": "Anrdoid, SDK 3.1.0.GA", "comment": { "comments": [ { "id": "248408", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cannot reproduce with Android emulator 4.1.2, Ti SDK 3.1 GA.\r\n\r\nPlease try the test case I added. The \"Table Top Value\" always logs 0 for me, and always has an effect on the top padding of the table.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-19T18:42:46.000+0000", "updated": "2013-04-19T18:42:46.000+0000" }, { "id": "248542", "author": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "body": "Sorry for bad test case I thought that situation is obvious. Try to add button and change top after proxy already created.\n\n{code}\nvar button = Ti.UI.createButton({text: \"Test\". height: 44, bottom: 0});\nwin.add(button);\n\nbutton.addEventListener(\"click\", function(){\ntable.top = 100;\n}\n{code}", "updateAuthor": { "name": "darknos", "key": "darknos", "displayName": "Sergey Nosenko", "active": true, "timeZone": "Europe/Helsinki" }, "created": "2013-04-20T22:18:39.000+0000", "updated": "2013-04-20T22:18:39.000+0000" }, { "id": "250177", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks, I can confirm it with that. I've updated the test case.\r\n\r\nTested and confirmed with Android emulator 4.1.2, Ti SDK 3.1 GA and 3.2 CI.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-03T22:34:46.000+0000", "updated": "2013-05-03T22:36:49.000+0000" }, { "id": "251447", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Added the missing super.propertyChanged\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4253\r\n", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-05-12T08:16:20.000+0000", "updated": "2013-05-12T08:16:20.000+0000" }, { "id": "252227", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport PR: https://github.com/appcelerator/titanium_mobile/pull/4273", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-15T22:59:38.000+0000", "updated": "2013-05-15T22:59:38.000+0000" }, { "id": "254892", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified as fixed and working as expected on Android Samsung Galaxy 4.2.2\r\n\r\nAppcelerator Studio 3.1.1.201305292130\r\nTitanium SDK 3.1.1.v20130529114554\r\nAlloy 1.1.3-alpha\r\nTitanium-Code-Processor 1.1.3-alpha3\r\n\r\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-30T17:54:21.000+0000", "updated": "2013-05-30T17:54:21.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }