{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2793","repository_url":"https://api.github.com/repos/NativeScript/NativeScript","labels_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2793/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2793/comments","events_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2793/events","html_url":"https://github.com/NativeScript/NativeScript/issues/2793","id":178588395,"number":2793,"title":"ListView unable to observe its bindingContext properly","user":{"login":"NordlingArt","id":2098838,"avatar_url":"https://avatars.githubusercontent.com/u/2098838?v=3","gravatar_id":"","url":"https://api.github.com/users/NordlingArt","html_url":"https://github.com/NordlingArt","followers_url":"https://api.github.com/users/NordlingArt/followers","following_url":"https://api.github.com/users/NordlingArt/following{/other_user}","gists_url":"https://api.github.com/users/NordlingArt/gists{/gist_id}","starred_url":"https://api.github.com/users/NordlingArt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NordlingArt/subscriptions","organizations_url":"https://api.github.com/users/NordlingArt/orgs","repos_url":"https://api.github.com/users/NordlingArt/repos","events_url":"https://api.github.com/users/NordlingArt/events{/privacy}","received_events_url":"https://api.github.com/users/NordlingArt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/iOS","name":"iOS","color":"fbca04"},{"url":"https://api.github.com/repos/NativeScript/NativeScript/labels/T:Question","name":"T:Question","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-22T11:46:47Z","updated_at":"2016-09-27T06:42:22Z","closed_at":null,"body":"**Platform:** iOS\r\n**TNS:** 2.3.0\r\n**Git repo:** https://github.com/NordlingArt/tns-issue-listview\r\n\r\nIf I make a checklist to a `ListView`, I need to observe an object property called `selected`, which is set to `false` as default, so I can either show or hide the checkbox.\r\n\r\nIn the Git repo, I have set up a `ListView` and a `Repeater`. Both use the same items `observableArray` and they both interact with each other. However, only `Repeater` will update its UI properly when selecting other options than the initially selected one.\r\n\r\nIt seems like the `ListView` can only observe the value if the condition is `true` from the beginning. See the `selected` property below:\r\n\r\n```js\r\nvar options = new ObservableArray(\r\n  new Observable({ index: 0, text: \"Option 1\", selected: true }),\r\n  new Observable({ index: 1, text: \"Option 2\", selected: false }),\r\n  new Observable({ index: 2, text: \"Option 3\", selected: false }),\r\n  new Observable({ index: 3, text: \"Option 4\", selected: false })\r\n);\r\n```\r\n\r\nCondition from the XML:\r\n\r\n```xml\r\n<StackLayout col=\"1\" class=\"checkbox\" visibility=\"{{ selected ? 'visible' : 'collapsed' }}\" />\r\n```\r\n\r\nI strongly suggest you take a look at the Git repo for a full demo of the issue."},"comment":{"url":"https://api.github.com/repos/NativeScript/NativeScript/issues/comments/249779681","html_url":"https://github.com/NativeScript/NativeScript/issues/2793#issuecomment-249779681","issue_url":"https://api.github.com/repos/NativeScript/NativeScript/issues/2793","id":249779681,"user":{"login":"NordlingArt","id":2098838,"avatar_url":"https://avatars.githubusercontent.com/u/2098838?v=3","gravatar_id":"","url":"https://api.github.com/users/NordlingArt","html_url":"https://github.com/NordlingArt","followers_url":"https://api.github.com/users/NordlingArt/followers","following_url":"https://api.github.com/users/NordlingArt/following{/other_user}","gists_url":"https://api.github.com/users/NordlingArt/gists{/gist_id}","starred_url":"https://api.github.com/users/NordlingArt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NordlingArt/subscriptions","organizations_url":"https://api.github.com/users/NordlingArt/orgs","repos_url":"https://api.github.com/users/NordlingArt/repos","events_url":"https://api.github.com/users/NordlingArt/events{/privacy}","received_events_url":"https://api.github.com/users/NordlingArt/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T06:42:22Z","updated_at":"2016-09-27T06:42:22Z","body":"@markosko - No difference in doing that unfortunately.\r\n\r\n@NickIliev - Thanks for investigating!"}}
{"actor":{"display_login":"NordlingArt"}}