title: dynamic radio button behaviour with knockout js
body: <p>I have a button to create radio buttons like this:</p>
  
  <pre><code>&lt;input value="&amp;uparrow;" type="button" data-bind=" click: moveUp"/&gt;
  &lt;input value="&amp;downarrow;" type="button" data-bind="click: moveDown"/&gt;
  &lt;input data-bind="value: selectedradio" /&gt;
  &lt;div data-bind="foreach: radios"&gt;
      &lt;div data-bind="attr:{id:radioid} "&gt;
         &lt;input type="radio" name="group" data-bind="value:radioid, checked:$parent.selectedradio"/&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  &lt;div&gt;
       &lt;input type="button" value="+" data-bind="click: addRadio"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>when the radio buttons are created they are each assigned a unique index and i have bound the checked attribute to a property on the parent called <code>selectedradio</code></p>
  
  <p>I am able to modify <code>selectedradio</code> though an html input and the selected radio will change but If I modify the value progmmatically it will not.</p>
  
  <p>I created a fiddle here: <a href="http://jsfiddle.net/8vVeU/" rel="nofollow">http://jsfiddle.net/8vVeU/</a></p>
  
  <p>here is the javascript for reference:</p>
  
  <pre><code>function Radio(id){
      this.radioid = ko.observable(id);
  }
  
   function ViewModel() {
          var self = this;
          self.selectedradio = ko.observable(0);
          self.radios = ko.observableArray([new Radio(0),new Radio(1),new Radio(2),new Radio(3)]);
  
          self.addRadio = function() {
              self.radios.push(new Radio());
              self.reIndex();
           };
           self.moveUp = function() {
              self.selectedradio(self.selectedradio()-1)
              self.reIndex();
            };
          self.moveDown = function() {
              self.selectedradio(self.selectedradio()+1)
              self.reIndex();
            };
  
          self.reIndex = function() {
              $.each(self.radios(), function(i, r) {
                  r.radioid(i);             
            });
          }
  
  
  }
  ko.applyBindings(new ViewModel());
  </code></pre>
  
  <p>How can I resolve this issue?</p>