Revision history [back]

click to hide/show revision 1
initial version

answered 2014-05-05 02:23:10 +0800

cor3000 gravatar image cor3000

You can register the Labels.getLabel(String, String) method in your zul file and access it like this:

assume you have a /WEB-INF/zk-label.properties containing the label property existing=existing value

<?xel-method prefix="my" name="labelDefault"
    class="org.zkoss.util.resource.Labels"   
    signature="java.lang.String getLabel(java.lang.String, java.lang.String)"?>    
<zk>
  <window border="normal" title="hello">
    <label value="${my:labelDefault('existing', 'default for existing')}"/>
    <label value="${my:labelDefault('not.existing', 'default for not existing')}"/>
  </window>
</zk>

the first label would output the label, the second one would fallback to the default given.

Robert

You can register the Labels.getLabel(String, String) method in your zul file and access it like this:this (also check the documentation/ImportJavaMethods)):

assume you have a /WEB-INF/zk-label.properties containing the label property existing=existing value

<?xel-method prefix="my" name="labelDefault"
    class="org.zkoss.util.resource.Labels"   
    signature="java.lang.String getLabel(java.lang.String, java.lang.String)"?>    
<zk>
  <window border="normal" title="hello">
    <label value="${my:labelDefault('existing', 'default for existing')}"/>
    <label value="${my:labelDefault('not.existing', 'default for not existing')}"/>
  </window>
</zk>

the first label would output the label, the second one would fallback to the default given.

Robert

You can register the Labels.getLabel(String, String) method in your zul file and access it like this (also check the documentation/ImportJavaMethods)):):

assume you have a /WEB-INF/zk-label.properties containing the label property existing=existing value

<?xel-method prefix="my" name="labelDefault"
    class="org.zkoss.util.resource.Labels"   
    signature="java.lang.String getLabel(java.lang.String, java.lang.String)"?>    
<zk>
  <window border="normal" title="hello">
    <label value="${my:labelDefault('existing', 'default for existing')}"/>
    <label value="${my:labelDefault('not.existing', 'default for not existing')}"/>
  </window>
</zk>

the first label would output the label, the second one would fallback to the default given.

Robert

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More