LoadBundle |
||
|
Developer’s Guide Home
Installation and Configuration Components Index Calendar Chart Confirmation Data Table Date Chooser Drop Down Field Dynamic Image Folding Panel Graphic Text Hint Label Popup Layer Suggestion Field Tab Set Tabbed Pane Tree Table Two List Selection Focus Load Bundle Scroll Position Ajax Support Validation Framework Tag Reference |
The QuipuKit LoadBundle component is used for loading a resource bundle localized for the Locale of the current view, and expose it (as a Map) in the request attributes of the current request. The <q:loadBundle> component is similar to the <f:loadBundle> from the Reference or MyFaces JSF implementation but can be used in the components with Ajax enabled. Creating the LoadBundleThe usage of the QuipuKit LoadBundle component is similar to the same component from the Reference or MyFaces JSF implementation. To add the LoadBundle component to the page, use the <q:loadBundle> tag. This tag has only var and basename attributes. The var attribute specifies the name of a request-scope variable under which the resource bundle is available. There are two ways to access keys of the resource bundle:
The basename attribute specifies the path to the resource bundle file. The resource bundle file should be available in the classpath. Here is an example of the resource bundle in the h:outputText component. <q:loadBundle basename="teamdev.demo.resources.TestLoadBundle" var="bundle"/> ... <h:outputText value="#{bundle.todayString}"/> In this example the resource bundle is located in WEB-INF/classes/teamdev/demo/resources directory. And there is a "todayString" property key in the TestLoadBundle resource bundle. In the following example the resource bundle in located in WEB-INF/classes directory and the "todayString" property key is used. <q:loadBundle basename="TestLoadBundle" var="bundle"/> ... <h:outputText value="#{bundle['todayString']}"/> |
|
| © 2008 TeamDev Ltd. | ||