message-loader-class"

From Documentation
 
Line 31: Line 31:
 
</source>
 
</source>
  
*[resources folder or cwr folder]/mycustom-msgzk.js
+
*[/src/main/resources/web]/mycustom-msgzk.js
 
<source lang="javascript">
 
<source lang="javascript">
 
msgzk.MYCUSTOM='customized';
 
msgzk.MYCUSTOM='customized';
 
</source>
 
</source>
  
*[resources folder cwr folder]/mycustom-msgzk_de.js
+
*[/src/main/resources/web]/mycustom-msgzk_de.js
 
<source lang="javascript">
 
<source lang="javascript">
 
msgzk.MYCUSTOM='angepasst';
 
msgzk.MYCUSTOM='angepasst';

Latest revision as of 06:39, 21 February 2019


message-loader-class



Syntax: <message-loader-class>class.qualified.name</message-loader-class>

Specifies an additional message loader class to load extra messages or customize default msgzk or msgzul entries. If the message loader declare a file pattern using wildcard "*", multiple Locale-based files can be defined and will be loaded according to the current user locale.

If the syntax "~./" is used, the resources can be loaded from the resources classpath (default in /src/main/resources/web/). Note: only a directory localed in the actual classpath can be used for this purposes for localized files.

Example,

  • Lang-addon.xml
<message-loader-class>foo.bar.MyCustomMessageLoader</message-loader-class>
  • foo.bar.MyCustomMessageLoader.java
public class MyCustomMessageLoader implements MessageLoader {

	@Override
	public void load(StringBuffer out, Execution exec) throws IOException {
		out.append(Devices.loadJavaScript(exec, "~./mycustom-msgzk*.js"));
	}

}
  • [/src/main/resources/web]/mycustom-msgzk.js
msgzk.MYCUSTOM='customized';
  • [/src/main/resources/web]/mycustom-msgzk_de.js
msgzk.MYCUSTOM='angepasst';

message-loader-class

[Required]

The message loader class. It must implement org.zkoss.zk.ui.metainfo.MessageLoader The loader .load(StringBuffer out, Execution exec) need to load the additional client-side messages and append them to the output buffer.


Version History

Last Update : 2019/02/21


Version Date Content
     



Last Update : 2019/02/21

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.