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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.1
    • 2.1, 2.0.5
    • core-serialization
    • None
    • 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 Lee Whitcomb

        Activity

          People

            rwhitcomb Roger Lee Whitcomb
            rwhitcomb Roger Lee Whitcomb
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: