Bidirectional binding with conversion

Tom Schindl tom.schindl at bestsolution.at
Fri Dec 9 04:43:22 PST 2011


Am 09.12.11 12:25, schrieb Daniel Zwolenski:
> Nice idea, I can see it being useful. 
> 
> Does it need to be limited to bidirectional bindings? Any reason unidirectional bindings cant use a converter too?
> 

Correct I don't see a reason for that.

> I wonder if we need a way to detect the failed parsing/formatting? For example if we were converting a TextField.textProperty to a Number (or Date) and it couldn't be parsed, I reckon I'd want to highlight the field as an error. Maybe this could be done with a custom formatter, is that the best way though?

Yes we should. Why don't we allow the method to return a type:

public static ValueBinding bindBidirectional(Property<String>
stringProperty, Property<?> otherProperty, Format format)

public ValueBinding bindBidirectional(Property<?> other, Format format)

class Binding {
  ObjectProperty<Status> status;

  public dispose() {

  }

}

We can then:
a) Observe the status of the binding
b) remove the need of the unbind method because we can dispose the
   binding

Tom

-- 
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                 geschäftsführer/CEO
------------------------------------------------------------------------
eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
http://www.BestSolution.at                      phone    ++43 512 935834


More information about the openjfx-dev mailing list