Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-974

Use of "importClass" or "importPackage" function in Javascript within BXML files won't work under Java 8 Nashorn script engine

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1, 2.0.5
    • Component/s: core-serialization
    • Labels:
      None
    • Environment:
      All

      Description

      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".

        Attachments

        1. 974.patch
          4 kB
          Roger Whitcomb

          Activity

            People

            • Assignee:
              rwhitcomb Roger Whitcomb
              Reporter:
              rwhitcomb Roger Whitcomb
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: