loadBundle

Version 1 by Mircea Toma
on Jun 19, 2014 13:05.


 
compared with
Version 2 by Ken Fyten
on Nov 13, 2014 10:52.


Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 4 changes. View first change.

 h2. Overview
 _Since 4.0_
  
 You can use the _icecore:loadBundle_ tag to load a resource bundle to be used for locale specific messages. The defined bundle is completely dynamic, meaning that if any of its attribute change at any time there will be no need to reload the page, session or application.
  
{tip}See the ICEfaces Showcase [Live Demo|http://icefaces-showcase.icesoft.org/showcase.jsf?grp=aceMenu&exp=loadBundleBean] of this component, complete with source code.{tip}
  
 h2. Getting Started
  
 To use the _icecore:loadBundle_ tag, first declare the core namespace:
  
 {panel}
 {code:html|borderStyle=dashed}
 <html ... xmlns:icecore="http://www.icefaces.org/icefaces/core">
 {code}
 {panel}
  
 Then add the tag to your page markup wiring the action to the bean method:
  
 {panel}
 {code:xml|borderStyle=dashed}
 <h:form id="form">
  ...
  <icecore:loadBundle var="wizardMessages" basename="com.bla.T.wizard.Messages"/>
  ...
 </h:form>
 {code}
 {panel}
  
 The component can be define anywhere in the document as long as it is defined before the components that use the bundle.
  
 {panel}
 {code:xml|borderStyle=dashed}
 <h:body>
  <icecore:loadBundle var="wizardMessages" basename="com.bla.T.wizard.Messages"/>
  ...
  <h:outputText value="#{wizardMessages.title}"/>
  ...
  <h:commandButton label="#{wizardMessages.nextStep}" ... />
  ...
 </h:form>
 {code}
 {panel}
  
 h2. Attributes
  
{tip:title=TagLib Documentation}This section covers attributes involved in the typical use-cases for this component. For reference, the complete taglib documentation for this component is available [here|http://res.icesoft.org/docs/v4_latest/core/comps/tld/icecore/loadBundle.html].{tip}
  
 {panel}
 *var* Use this attribute to specify the name of the EL variable that will be used to referenced the defined bundle. This attribute can be dynamically redefined, so a value binding will work as well.
  
 *basename* Use this attribute to specify the fully qualified name of the ResourceBundle class that will be instantiated in order to serve up the localised message. If the class is not found a resource bundle properties file is looked up instead. See more about how resource bundles work: http://docs.oracle.com/javase/7/docs/api/java/util/ResourceBundle.html . This attribute can be dynamically redefined, so a value binding will work as well.
  
 {tip}The loadBundle tag was added in ICEfaces 4.0.{tip}

© Copyright 2017 ICEsoft Technologies Canada Corp.