Hoppa till huvudinnehållet

How to load a dependent viewer module

Kommentarer

6 kommentarer

  • Berend Veldkamp
    To answer my own question, I found the Application.awaitModulesForCommand() in the AMD type definition file. This is exactly what I needed.
    0
  • Permanently deleted user
    Hi,

     

    I had the same problem when updating to the latest viewer. Had custom modules and this.app.getWorkflowActivityDispatcher()  stopped returning a value instead returning NULL. Tried in desktop.json to use deferLoading: false for those modules but to no avail.

     

    Could you give me a bit more detail where you used the Application.awaitModulesForCommand()?

     

    Thanks in advance.

     

     
    0
  • Berend Veldkamp
    You need to call it when calling a method from another module. In your case, you probable need to wait for the Workflow module to be loaded. From the top of my head: // Untested: this.app.awaitModules(["Workflow"]).then(() => { this.app.getWorkflowActivityDispatcher(); });
    0
  • Permanently deleted user
    This of course causes a crash in essentials.bundle.js on:

     

    "geocortex/workflow/WorkflowControllerProxy": function ()

     

     o = n.encodeJson(dojo.mixin({ f: "json" }, o)), null != t && (t.isBusy = !0), t.webRequestBegin(s, e)

     

    The "t" is the dispatchhandler that is null.

     

    Hence why I wanted to know if the Application.awaitModulesForCommand() solved this for you.

     

    Thanks again
    0
  • Permanently deleted user
    Thanks for the answer.

     

    I'm going to try your suggestion. My fix so far has been setting the "deferLoading" on the Workflow Module in Desktop.json  to "false".

     

    This cleared the problem. 

     

    But of course your suggestion would be more resource load "cheaper".
    0
  • Berend Veldkamp
    Yes, that was what fixed it for me. Note that if you use awaitModulesForCommand(), you'd have to pass the name of a command (e.g. 'RunWorkflowById'), and with awaitModules() the name(s) of one or more modules.

     

    I haven't seen the error you posted.
    0

Du måste logga in om du vill lämna en kommentar.