groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tx. T" <txt8...@yahoo.com>
Subject GroovyFx binding to two properties
Date Fri, 20 Jan 2017 13:23:48 GMT
how would I go about binding the textProperty of two textfields to a button's disable (on/off)?
 Here is an example of binding to 1 textfield.  I like to know how to do similar but with
2 or more textfields.Basically, if two textfields are empty, the submit button is disable,
else.#!/usr/bin/env groovy

import static groovyx.javafx.GroovyFX.start

start {
    stage title: "Test App", visible: true, {
        scene {
            hbox {
                tf = textField(id: "tf")
                button('Submit', id: "smb", disable: bind(tf.textProperty()).using { it.isEmpty()
})
            }
        }
    }
}
Mime
View raw message