FXML Nashorn Jira Issue Marked Resolved But Is Not - RT-31776

Milan Kubec milan.kubec at oracle.com
Thu Aug 22 00:13:37 PDT 2013

The issue stated that it was resolved as duplicate and the duplicate
issue is still open (RT-30986), nobody stated the issue is fixed.

Unfortunatelly there was confusion and there are in fact two issues
(with very similar manifestation). One is missing importClass from
Nashorn, which we will need to document in FXML documentation.
Workaround is to use FQN of the class. Or use mozilla_compat.js.

The other is change in Nashorn binding handling semantics when calling
eval() on user's script - which is in fact the issue RT-31776 (I have
reopened the issue). We have filed issue againt Nashorn engine and we
are waiting for resolution of the issue. The problem could be fixed on
FXML side, but the fix would change semantics of user's script execution.


Dne 22.8.2013 0:59, TA Hubbard napsal(a):
> Mr. Bair:
> The following FXML script is fundamental to FXML according to
> "Introduction To FXML"
> (http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html#scripting),
> but is no longer compiling without errors (since jdk8-b91 through b103):
> <?language javascript?>
> <?import javafx.scene.control.*?>
> <?import javafx.scene.layout.*?>
> <VBox xmlns:fx="http://javafx.com/fxml">
>     <fx:script>
>     importClass(java.lang.System);
>     function handleButtonAction(event) {
>        System.out.println('You clicked me!');
>     }
>     </fx:script>
>     <children>
>         <Button text="Click Me!" onAction="handleButtonAction(event);"/>
>     </children>
> </VBox>
> The Jira (RT-31776) states that the issue is resolved, but it isn't. 
> In fact, trying to compile with the language processing instruction
> <?language javascript?> produces a NullPointerException.  All other
> error messages are Nashorn related.
> A Nashorn rep states that it is because of their non-support of
> importClass.  He recommends mozilla_compat.js.  However, FXML
> documents are not compiling even without the importClass 'and' they
> are producing null pointer messages with just the inclusion of the
> language processing instruction.
> If this FXML feature was deprecated with Rhino, can you officially
> state and document it, or offer an official solution?
> Thanks.

More information about the openjfx-dev mailing list