vendredi 10 avril 2015

groovy binding to a map element


Vote count:

0




Is it possible to bind to a map element ?



mybean = new MyBean()
swing.edt {
dialog() {
vbox(){
label(text: '> Please enter your developer account')
def tf = textField(columns:10)
bean mybean, myMap.myKey: bind {tf.text}
button(defaultButton: true, text: 'OK', actionPerformed: {dispose() },
enabled: bind {new File(userBean.myMap.myKey).exists()})
}
}
}


with



@Bindable
class MyBean {
Map<String,String> myMap
}


OR maybe I do this the wrong way. I want to enable the OK button only if the stuff entered in the text field is valid. I want to store the content of the text field in a specific key of the myMap map from the myBean bean, and then check the file existence



asked 1 min ago







groovy binding to a map element

Aucun commentaire:

Enregistrer un commentaire