-
Bug
-
Resolution: Fixed
-
P2
-
None
-
None
Scene Builder should never save a corrupt FXML file under any circumstances. Today it is possible to create such a thing by duplicate fx:id values. In particular, if the same fx:id is used by a ToggleGroup and by some other thing then depending exactly on how it is resolved, the loader may try to set the ToggleGroup of a ToggleButton to that other thing, which will cause the whole load to fail.
Changing fx:id values is a bit radical because they are used during injection. I think the right thing to do is to change them only when they appear in an fx:ref somewhere. We could special-case the treatment of ToggleGroups, and keep a map of all ToggleGroup ids on hand at all times, but I think it would be much better to change the SaveFxml logic so that it generates unique fx:id values if it detects fx:ref conflicts.
Changing fx:id values is a bit radical because they are used during injection. I think the right thing to do is to change them only when they appear in an fx:ref somewhere. We could special-case the treatment of ToggleGroups, and keep a map of all ToggleGroup ids on hand at all times, but I think it would be much better to change the SaveFxml logic so that it generates unique fx:id values if it detects fx:ref conflicts.