{"id":345,"date":"2016-08-04T20:47:41","date_gmt":"2016-08-04T20:47:41","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=345"},"modified":"2016-08-04T20:47:41","modified_gmt":"2016-08-04T20:47:41","slug":"nativescript-declarative-ui-not-updating","status":"publish","type":"post","link":"http:\/\/fluentreports.com\/blog\/?p=345","title":{"rendered":"NativeScript: Declarative UI not updating?"},"content":{"rendered":"<p><a href=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-346 alignleft\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns.jpg\" alt=\"stop-ns\" width=\"281\" height=\"281\" srcset=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns.jpg 1024w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns-150x150.jpg 150w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns-300x300.jpg 300w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns-768x768.jpg 768w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2016\/08\/stop-ns-624x624.jpg 624w\" sizes=\"auto, (max-width: 281px) 100vw, 281px\" \/><\/a>This is just a heads up so that others don't waste the time I wasted; trying to figure it out...<\/p>\n<p>So, I've been working all day on a really cool NS app for a client; made LOTS of graphical changes;\u00a0 Gradients, shadows, borders, opacity, custom built fonts, themes, tap effects, etc -- looks and acts really sweet...<\/p>\n<p>So I start the app up again and it changes several fields frequently so all of a sudden the display appears locked up; none of the values are changing while just watching it...\u00a0\u00a0 I click on a button and the display updates; properly.\u00a0 Weird.\u00a0 So I do it again, and again it freezes about 10 seconds into doing updates; interacting with certain things in the app and bam the display starts updating again; and 5 seconds later it the ui stops and is no longer updating again...\u00a0\u00a0 Argh...\u00a0 Inconsistent issues are hard to trace..<\/p>\n<p>So I run the copy of the app that I had deployed to my actual phone from this morning; and everything works great -- not as pretty; but no display glitches.<\/p>\n<p>Ok, so now I'm thinking some change I did has broken the Observables some how, maybe the Obs notification is crashing, or being eaten.\u00a0 So I start debugging and basically waste about a bit of time tracing things back and even add code to verify that the Observable is sending property change notices properly...\u00a0\u00a0 So, after doing a bit of work, everything programmatically looks correct; everything is still bound, the binding context is still valid; the Observable is sending the updates properly; everything looks correct in memory; just the labels don't update...<\/p>\n<p>I start writing up an issue in the NS repo to ask for some more pointers on how to trace down why an Observable is sending notifications, the label is bound and listening; and the label actually shows the updates for a random numbers of seconds but then just randomly stops updating (but can be \"kicked\" by doing things in the app)..\u00a0 Yes, that weird of a problem.<\/p>\n<p>Well, before I finish writing up the issue I decide to try a hail-mary as my dad would say.\u00a0 I killed the emulator; started it back up and....\u00a0\u00a0 <strong>Everything works....<\/strong>\u00a0\u00a0\u00a0 Ugh, wasted a lot of time; but the good new is it wasn't my app -- my app works great...<\/p>\n<p>So the point of this story -- if you start getting any unexpected random display update glitches; try rebooting the emulator...<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is just a heads up so that others don't waste the time I wasted; trying to figure it out... So, I've been working all day on a really cool NS app for a client; made LOTS of graphical changes;\u00a0 Gradients, shadows, borders, opacity, custom built fonts, themes, tap effects, etc -- looks and acts&hellip; <a class=\"more-link\" href=\"http:\/\/fluentreports.com\/blog\/?p=345\">Continue reading <span class=\"screen-reader-text\">NativeScript: Declarative UI not updating?<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-345","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"_links":{"self":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=345"}],"version-history":[{"count":1,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/345\/revisions"}],"predecessor-version":[{"id":347,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/345\/revisions\/347"}],"wp:attachment":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}