View Source

h2. Overview
_Since 4.0_

You can use the _icecore:loadBundle_ tag to load a resource bundle to be used for locale specific messages. Unlike the standard h:loadBundle component, the icecore:loadBundle is completely dynamic, meaning that if any of its attributes changethere 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.