FXML expression binding scope
Werner Lehmann
lehmann at media-interactive.de
Tue May 22 04:00:00 PDT 2012
Hi Greg,
thanks for explaining - makes perfect sense.
Werner
On 21.05.2012 19:16, Greg Brown wrote:
>> <Label fx:id="label" text="more" managed="${visible}"/>
>
>
> Another thing to consider is that the above markup translates roughly into the following Java code:
>
> label.managedProperty().bind(visibleProperty());
>
> This would create a binding between the "managed" property and the "visible" property of the calling class, which is not what you want. The Java equivalent for the binding you want is this:
>
> label.managedProperty().bind(label.visibleProperty());
>
> which translates to the following in FXML:
>
> <Label fx:id="label" text="more" managed="${label.visible}"/>
>
> G
>
More information about the openjfx-dev
mailing list