You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Roger Whitcomb (JIRA)" <ji...@apache.org> on 2015/07/21 17:33:05 UTC
[jira] [Resolved] (PIVOT-974) Use of "importClass" or
"importPackage" function in Javascript within BXML files won't work under
Java 8 Nashorn script engine
[ https://issues.apache.org/jira/browse/PIVOT-974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Roger Whitcomb resolved PIVOT-974.
----------------------------------
Resolution: Fixed
All seems good now.
> Use of "importClass" or "importPackage" function in Javascript within BXML files won't work under Java 8 Nashorn script engine
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: PIVOT-974
> URL: https://issues.apache.org/jira/browse/PIVOT-974
> Project: Pivot
> Issue Type: Bug
> Components: core-serialization
> Affects Versions: 2.1
> Environment: All
> Reporter: Roger Whitcomb
> Assignee: Roger Whitcomb
> Priority: Critical
> Fix For: 2.1, 2.0.5
>
> Attachments: 974.patch
>
>
> A small script such as this in a BXML file now will not work in Java 8:
> <bxml:script>
> importClass(org.apache.pivot.wtk.Button);
> function isSelected(state) {
> return state == Button.State.SELECTED;
> }
> </bxml:script>
> The reason is that the "importClass" function is not present in the base Nashorn engine, but is provided by a compatibility library: "mozilla_compat.js".
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)