title: JavaFX & FXML: assign ChangeListener to observable property
body: <p>According to the <a href="http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html#event_handler_attributes" rel="nofollow">JavaFX tutorial</a> it should be possible to register event handlers to observable properties in FXML:</p>
  
  <blockquote>
    <p>Any class that defines a setOnEvent() method can be assigned an event handler in markup, as can any observable property (via an "onPropertyChange" attribute).</p>
  </blockquote>
  
  <p>Now, I'm trying to register an event handler for the selected property of ToggleButton:</p>
  
  <pre><code>&lt;ToggleButton text="%SomePane.fooButton.text" onSelectedChanged="#handleFooSelectedChanged" toggleGroup="$toggleGroup"/&gt;
  </code></pre>
  
  <p>and in the controller:</p>
  
  <pre><code>@FXML
  public void handleFooSelectedChanged(ObservableValue&lt;? extends Boolean&gt; observable, Boolean oldValue, Boolean newValue) {
  
  }
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <blockquote>
    <p>Caused by: javafx.fxml.LoadException: Controller method
    "handleFooSelectedChanged" not found.</p>
  </blockquote>
  
  <p>Do I have to change the method signature? Is this a bug? Or is this not supported at all?</p>