Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-1811

[PATCH] Flow Script: Allow dynamic loading of JavaScript objects even when scope is locked

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.9, 2.2
    • 2.1.10, 2.2
    • Blocks: Forms
    • None
    • Normal
    • Patch available

    Description

      Currently it is not possible to add variables to the scope of a FOM_JavaScriptInterpreter, unless the scope is not locked yet or when still in the main loading process or when loading native java classes. Therefore it is not possible to dynamically load JavaScript classes like the one below:.


      -------------------------------
      function myObject() { // at this point the current
      implementation throws the exception
           // constructor for myObject
      }

      myObject.prototype.myMethod = function() {
          // implementation of myMethod
      }
      -------------------------------


      from within a script fragment like this one:


      -------------------------------
      function loadScript() {
          var scriptURI = "determineScriptURIFromRequest";
          cocoon.load(scriptURI);
      }
      -------------------------------

      The attached patch solves this by allowing also objects of the type org.mozilla.javascript.Function to be loaded into a locked scope.

      Attachments

        1. 20060409-cocoon-forms-1811
          1 kB
          Rob Berens

        Activity

          People

            joerg.heinicke@gmx.de Jörg Heinicke
            rberens@osirion.nl Rob Berens
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: