-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for labelFor property in javafx.scene.control.Label #55
Comments
Original comment by gerardo balderas (Bitbucket: gbalderas, GitHub: gbalderas): If the labelFor is pointing to an fxid, it will not be removed. But if the fxid is changed it will be removed. I think it is because it cannot find a reference to it anymore. I think this issue is a bit unclear, do you want to be able to set the labelFor property directly from the SceneBuilder or just that it won't be removed or update it when the fxid changes? |
Original comment by Fabrice Bouyé (Bitbucket: fabricebouye, GitHub: fabricebouye): Back and authenticated this time. In my experience (8.1.0) it is removed every time from the FXML when editing with SceneBuilder. It should NEVER be removed if defined in the FXML. It's pretty clear that this property needs to have support in SceneBuilder's UI. Currently there is no field to set this property in the UI. Also there is currently a JavaFX / FXML bug related to that property : [FXML] setting labelFor on FXML is complicated (https://bugs.openjdk.java.net/browse/JDK-8090250) which makes the value appear null after the FXML has been loaded because FXMLLoader does not do a second pass after loading an FXML to resolve unresolved ids. |
…pe (pull request #55) Issue 158/including fxml fails with npe Approved-by: Jose Pereda <[email protected]> Approved-by: Joeri Sykora <[email protected]>
This issue still persists with Scene Builder 20.0.0. using Java and JavaFX 20.0.1. |
As there were two points raised, it is not clear what "This issue still persists" from the previous comment refers to, so I'm writing this a bit more verbose. I'm using the same version: JavaFX Scene Builder 20.0.0 with JavaFX Version: 20.0.1 on Java 20.0.1.
Given that JDK-8090250 mentions that the order of elements matters, I have the following FXML, where I placed the TextField before the Label. When I open, modify, and save the file in SceneBuilder, the labelFor property remains. <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1">
<children>
<GridPane>
<children>
<TextField fx:id="myCustomField" GridPane.columnIndex="1" />
<Label labelFor="$myCustomField" text="My Custom Label" />
</children>
</GridPane>
</children>
</VBox>
|
Originally reported by: Anonymous
It seems that SceneBuilder has added support for the accessibility fields added recently (in JDK8_40?) but it still missing the support for the basic labelFor property of the javafx.scene.control.Label class.
This attribute can be set manually in the FXML by doing:
Unfortunately SceneBuilder will erase those values if you happen to open the FXML later in it.
The text was updated successfully, but these errors were encountered: