No SimpleStringProperty.bind(Property, StringConverter) method

Andy Till kittyburrito at googlemail.com
Sun Oct 7 06:47:54 PDT 2012


Is there a reason why no SimpleStringProperty.bind(Property, 
StringConverter) exists but 
SimpleStringProperty.bindBidirectional(Property, StringConverter) does 
or is this just an omission that I could perhaps request to be implemented?

I have a SimpleIntegerProperty that is bound to a NumberBinding.  A 
TextField.textProperty is then bound to the SimpleIntegerProperty but it 
throws the following exception:

java.lang.RuntimeException: A bound value cannot be set.
     at 
javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:159)
     at 
javafx.beans.property.IntegerProperty.setValue(IntegerProperty.java:80)
     at 
javafx.beans.property.IntegerProperty.setValue(IntegerProperty.java:72)
     at 
com.sun.javafx.binding.BidirectionalBinding$StringConversionBidirectionalBinding.changed(BidirectionalBinding.java:550)
     at 
com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:367)
     at 
com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
     at 
javafx.scene.control.TextInputControl$TextProperty.fireValueChangedEvent(TextInputControl.java:1034)
     at 
javafx.scene.control.TextInputControl$TextProperty.markInvalid(TextInputControl.java:1038)
     at 
javafx.scene.control.TextInputControl$TextProperty.invalidate(TextInputControl.java:978)
     at 
javafx.scene.control.TextInputControl$TextProperty.access$200(TextInputControl.java:950)
     at 
javafx.scene.control.TextInputControl$1.invalidated(TextInputControl.java:119)
     at 
com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:155)
     at 
com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
     at 
javafx.scene.control.TextField$TextFieldContent.insert(TextField.java:79)
     at 
javafx.scene.control.TextInputControl$TextProperty.doSet(TextInputControl.java:1047)
     at 
javafx.scene.control.TextInputControl$TextProperty.set(TextInputControl.java:973)
     at 
javafx.scene.control.TextInputControl$TextProperty.set(TextInputControl.java:950)
     at 
javafx.beans.property.StringProperty.setValue(StringProperty.java:84)
     at 
javafx.beans.property.StringProperty.setValue(StringProperty.java:76)
     at 
com.sun.javafx.binding.BidirectionalBinding.bind(BidirectionalBinding.java:108)
     at javafx.beans.binding.Bindings.bindBidirectional(Bindings.java:655)
     at 
javafx.beans.property.StringProperty.bindBidirectional(StringProperty.java:128)


More information about the openjfx-dev mailing list