Try our conversational search powered by Generative AI!

REgistering multiple dojo/dijit modules in module.config

Vote:
 

Hi all,

I have a couple of dojo/dijit components that ive developed for V7. They are both within my main VS project and therefore the module.config file is in the root.

My module.config looks like so:

<?xml version="1.0" encoding="utf-8"?>
<module>
  <assemblies loadLocalBin="true">
    <add assembly="MyAssembly" />
  </assemblies>

  <dojoModules>
    <add name="communityuser" path="CommunityUser/Scripts" />
    <add name="user" path="User/Scripts" />
  </dojoModules>

  <clientResources>
    <add name="user.requiremodule" path="user/Scripts/RequireModule.js" resourceType="Script" />
    <add name="communityuser.requiremodule" path="communityuser/Scripts/RequireModule.js" resourceType="Script" />
  </clientResources>

  <clientModule initializer="user/Initialize">
    <requiredResources>
      <add name="user.requiremodule" />
    </requiredResources>
  </clientModule>
  <clientModule initializer="communityuser/ModuleInitializer">
    <requiredResources>
      <add name="communityuser.requiremodule" />
    </requiredResources>
  </clientModule>

</module>

The problem im running into is that only one of the initializer methods are ever called, whichever one is in the module.config file first. In the example above the user/Initialize file will be called, if I swap the order of the clientModule's, the communityuser/ModuleInitializer file will be called.

Any pointers please? Do i perhaps need to have seperate files, one for each component?

Thanks in advance

Al

#79362
Dec 14, 2013 17:54
Vote:
 

Any thoughts dojo wizards?

#79405
Dec 16, 2013 15:30
Vote:
 

Hello

In module.config there should be only one client module with one client initializer. A client modules should have initialize method like in the example here.  The rest of modules client components can be initialized in the initialize method. You can also take a look on epi/shell/ShellModule as an example (you might need to install "EPiServer Edit UI – Client side debug support" add-on in order to see the source code)

#79445
Dec 17, 2013 14:33
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.