groovyfx-project / groovyfx

A library for writing JavaFX 8 applications in the Groovy language.
http://groovyfx.org
Apache License 2.0
199 stars 50 forks source link

Exception using binding inside BorderPane #30

Closed shnplr closed 8 years ago

shnplr commented 9 years ago

If a node containing binding is added directly into borderPane (top, center..etc) we get an exception. e.g. groovy.lang.MissingMethodException: No signature of method: groovyx.javafx.factory.BorderPanePosition.addNode() is applicable for argument types: (groovyx.javafx.binding.BindingHolder) values: [groovyx.javafx.binding.BindingHolder@2d3e0ea3] Possible solutions: addNode(javafx.scene.Node), getNode(), hashCode()

Possible Solution:

BorderPanePositionFactory public void setChild( FactoryBuilderSupport builder, Object parent, Object child ) { parent.addNode(child); }

above method should ensure child instanceof Node

User workaround is to wrap the node using a container that supports binding e.g. hbox etc