|
From: Andy D. <an...@ma...> - 2007-10-08 20:45:20
|
I've been eying ConfigurableFormModel.add(String propertyName,
ValueModel valueModel) in order to support binding components to derived
properties, but it doesn't appear "add" will work unless a property with
'propertyName' exists on the backing object. There is even a comment in
the code that says:
// XXX: this is very broken as it assumes that the added value
model was derived
// from the property access strategy when this is not always the
case.
What I'd like to do is allow someone to bind to an expression rather
than a property. Something like: binder.bindControl(control,
"${subtotal + tax + shipping}"). Internally, I'll add a custom property
to the form using the add(...) method above, with the ValueModel
computing the result of the expression, as well as listening to the
individual properties involved in the expression so that it fires a
property change event when any of the source properties change. Anyway,
if the "add(...)" method worked, this would be fairly easy to implement.
Anyone have a problem if I go in and make add(...) work on properties
that do not exist on the backing bean? Does anyone rely on add(...)
throwing an exception for non-existing properties?
- Andy
|