title: Adding RadioMenuItem to ToggleGroup in FXML
body: <p>Somewhere inside my FXML, I have this:</p>
  
  <pre><code>&lt;fx:define&gt;
    &lt;ToggleGroup fx:id="toggleGroup1"/&gt;  
  &lt;/fx:define&gt;
  &lt;Menu fx:id="toggleMyView" text="%MyView"&gt;
    &lt;items&gt;
      &lt;RadioMenuItem text="%hide"
                     selected="true"
                     onAction="#handleLoadComponent"
                     toggleGroup="toggleGroup1"/&gt;`
  </code></pre>
  
  <p>Somehow I get the error:</p>
  
  <p><code>Unable to coerce toggleGroup1 to class javafx.scene.control.ToggleGroup</code></p>
  
  <p>But why?</p>
  
  <p>What I'm trying to do is to create a <code>Menu</code> containing several of <code>RadioMenuItem</code> which are all in the same ToggleGroup. How can I add them to the toggle group in my FXML file?</p>