s:dojoInitializer

The dojo initializer is the first of a set of dojo enabled components. This is not an end user component but should allow the quick testing and hacking of dojo code.

The main reason for this component is, that it is rather complicated and not very well documented on how to do a proper initialisation of the dojo javascript subsystem. To get a quickstart a initializer tag which takes care of most of the boilerplate details can be helpful.

Some examples for the dojo initializer used in various stages of page development can be found in the dojo subdirectory of the myfaces sandbox examples.

Usage:

<s:dojoInitializer require="package" provide="package" debug="true/false"  debugAtAllCosts="true/false" ..../>	
TODO add the additional initializer attributes

Example:

 <s:dojoInitializer require="dojo.widget.Editor" debug="true"/>	
 <s:dojoInitializer require="dojo.widget.DebugConsole" debugAtAllCosts="false"/>	
 <s:dojoInitializer require="dojo.widget.ResizeHandle" />	
 <s:dojoInitializer debugConsole="true" expanded="true"/>


<f:verbatim>
    <script type="text/javascript" >
	function generateSomeDebuggingInfo() {
	  for (var x=0; x<10; x++) {
		dojo.debug(x + ": Here is some debugging info, should be 10 new lines");					
	}
	dojo.debug("also note the usage of the expanded attribute");
	dojo.debug("this attribute set to true loads the expanded version");
	dojo.debug("otherwise the non expanded version is loaded");
						}
   </script>
   </f:verbatim>
<h:form>	
  <h:commandButton id="triggerdojo" onclick="javascript:generateSomeDebuggingInfo();return false;" value="[Press me for debug infos]"></h:commandButton>
...

  • No labels