Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7-rc-2
-
None
-
None
-
Actually saw this in Griffon 0.3 snapshot, but is a @Bindable issue
Description
Currently a binding's validator only reacts to a change and is not given a chance to react to any initial data.
Given:
Model:
@Bindable String data = 'x'
View:
textField(id: 'port', columns: 5, text: bind(source: model, 'port', mutual: true, validator: { isInteger(port) }))
As created, the textField will contain 'x', even though an isInteger validator method (assuming one exists and is correct) would reject it. If 'y' is subsequently typed into the field, the validator will run and will (presumably)reject the contents.
More discussion and workaround here: http://archive.codehaus.org/lists/org.codehaus.griffon.user/msg/001701ca7885$a4925f40$edb71dc0$@com.au