Sep 1, 2011, 6:42 PM
64 Posts

How does one dynamically set djConfig parameters?...

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.1
  • Role: Developer
  • Tags: djConfig dynamic
  • Replies: 1
- I would like to dynamically set djConfig parameters for dojo on a XPage.  The <xp:view> tag only supports dojoParseOnLoad and dojoTheme; it's not possible to add other things.  In particular I'd like to set the locale to a value of my choosing instead of the automagic setting it for me.  I've searched for a time and found not one single hit relating to this topic; nor has "Mastering XPages" bourne fruit.
- Is this possible, and how would one go about it?
Thanks for your time...
Sep 6, 2011, 5:27 AM
122 Posts
Re: How does one dynamically set djConfig parameters?...
There are a variety of ways round this. If you want it server-wide go to in <Domino>\data\properties folder on your server. Just uncomment the line for djConfig, and add the parameters you want, as on the Dojo website. I'm not sure if doing a Restart Task HTTP will be enough, I guess it should be. That will definitely work on 8.5.2.
At an application level, you also have an file, available under WebContent\WEB-INF in Package Explorer view. The parameter will be the same as in the, xsp.client.script.dojo.djConfig. When preparing for my session on Dojo at LS11, this did not work for changing the Dojo version on 8.5.2 - the server overrides. But it may work for just changing the locale. It looks like it would work with 8.5.3, because in the beta (may change for Gold) you can change the Dojo version at app level using
At XPage level, you may also be able to add a Head tag. I blogged about it a while back here You need to do it in All Properties. If the app level change in doesn't work though, this almost certainly won't work either.