FXMLLoader assumptions...

Werner Lehmann lehmann at media-interactive.de
Tue May 28 10:42:58 PDT 2013


just ran into an unexpected feature of the FXML loader. Basically, if 
you have FXML like this...

<SomeControl onFooChange="#fooChange"/>

...it would expect SomeControl to have an observable property "foo". 
Otherwise a javafx.fxml.LoadException is thrown: "SomeControl does not 
define a property model for "foo"."

Of course I don't have that foo property but still want to name my event 
"FooChange". Actually, FXMLLoader has special code which looks for 
"on*Change" attributes. Event handler attributes with other name 
patterns work. Shouldn't this work for non-existing foo as well?

See FXMLLoader.Element.addEventHandler...


More information about the openjfx-dev mailing list