構文
{bind
[at [ [: ] =]
[ ]
]
to
[in [ [: ] =]
[ ]
]
[as ]
[, default-value = ]
[,{format [ :[ ] as]
}
]
[, {parse [ :[ ] as]
}
]
[, {report
}
]
[, allow-update?=true/false]
[, auto-register?=true/false]
}
説明
例
{RecordForm record-source = user-records, ... {TextDisplay {bind value to "user-name"} } }
{RecordForm record-source = user-records, ... {TextDisplay {bind value to "account-balance"}, {bind color to "account-balance", {format balance:double as {if balance < 0 then "red" else "black"} } } } }
{RecordForm record-source = user-records, ... {TextField {bind value at tf:TextField to "user-name" in rf:RecordForm as binding, {parse val:String as {if val.length < 10 then {DataBindingValidationFailure "Name must contain at least ten characters" } else val } }, {report {if-non-null err = binding.validation-failure then {popup-message err.value} set tf.color = "red" else set tf.color = "black" } } } } }