This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236955

Summary: Wrong error message when using fx:root
Product: javafx Reporter: maxnitribitt <maxnitribitt>
Component: EditorAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: normal CC: maxnitribitt
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: Example

Description maxnitribitt 2013-10-09 16:39:26 UTC
When using fx:root, typically the controller is set on FXMLLoader, and not in the FXML-Document. Still NetBeans shows an error in the FXML-Editor if there's no controller defined and we use attributes to call controller methods.

To reproduce download this NetBeans Project from Oracle's FXML Tutorial:
http://docs.oracle.com/javafx/2/fxml_get_started/CustomControlExample.zip

Open the FXML-File. "#doSomething" will be underlined red. The error message says:
"Controller is not defined on fx:root Element", which is actually expected behavior.
Comment 1 maxnitribitt 2013-10-10 06:56:59 UTC
Created attachment 140970 [details]
Example

Actually this is not only true for fx:root. Another Example where I'm using a valid fxml with "AnchorPane" as root element. Again no controller set in FXML, but via:

FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("FXMLDocument.fxml"));
fxmlLoader.setController(new FXMLDocumentController());
Parent root = (Parent)fxmlLoader.load();