Ah I see the problem, this is a tough one. In order to have things such as ws-var from a server-side template working correctly, there's a post-init phase that runs after all your client <@ ... @> and OnAfterRender initializations and basically does a .Bind() on the page without explicit fillers. But this means that trying to .Bind() yourself afterwards will not do anything, since it's already been done. I don't know how to improve this to be honest, but I'll think about it.

Meanwhile here's a good way to work around it. I also think it's a better way to structure an application like this, regardless of the bug:

  • store the region in a Var<string>;
  • do the .Bind() immediately on load, but passing it a dynamic region.View : View<string> instead of a constant region : string;
  • in the Ajax callback, just set the value of the Var.

Here is a fork of your project with the above changes.

By on 11/5/2018 9:07 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper