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 - Wrong error message when using fx:root
Summary: Wrong error message when using fx:root
Status: NEW
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Mac OS X
: P3 normal with 2 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-09 16:39 UTC by maxnitribitt
Modified: 2013-10-10 06:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example (39.41 KB, application/zip)
2013-10-10 06:56 UTC, maxnitribitt
Details

Note You need to log in before you can comment on or make changes to this bug.
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();