title: Proper way to bind a Property to a Value derived from a control in JavaFx / TornadoFX
body: <p>Consider the (kotlin/tornadofx) example below, which aims to connect the contents of a textfield with the text of a label through binding. The label should reflect a derived value of the textfield, in this case the hash. How do I properly achieve this binding (I feel that using a changelistener is not the proper way to go).</p>
  
  <pre><code>class HashView : View("My View") {
      val hashProperty = SimpleStringProperty("EMPTY")
  
      override val root = vbox {
          textfield {
              hashProperty.bind(stringBinding(text) { computeHash(text)}) // This does not work
          }
          label(hashProperty)
      }
  }
  </code></pre>
  
  <p>PS: answers in java / JavaFX are also welcome as long as I can somehow apply the idea in tornadofx as well.</p>
  
  <p><strong>UPDATE 1</strong>: I have discovered that there was only a minor change necessary to make my example work, namely it should be</p>
  
  <pre><code>hashProperty.bind(stringBinding(textProperty() { computeHash(this.value) })
  </code></pre>
  
  <p>I am however still not certain whether this is the conventional way to do it. So I'm going to leave this question open.</p>