LoadBundle |
||||
Developer’s Guide Home
Installation and Configuration Common Concepts Components Index Border Layout Panel Calendar Chart Command Button Command Link Composite Filter Confirmation Data Table Date Chooser Day Table Drop Down Field Dynamic Image Folding Panel For Each Graphic Text Hint Label Input Text Input Textarea Layered Pane Level Indicator Popup Layer Popup Menu Select Boolean Checkbox Select Many Checkbox Select One Radio Spinner Suggestion Field Tabbed Pane Tab Set Tree Table Two List Selection Window Focus Load Bundle Scroll Position Ajax Framework Validation Framework Tag Reference API Reference |
Creating the LoadBundleThe usage of the OpenFaces 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 <o: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. <o:loadBundle basename="my.resources.TestLoadBundle" var="bundle"/> ... <h:outputText value="#{bundle.todayString}"/> In this example the resource bundle is located in WEB-INF/classes/my/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. <o:loadBundle basename="TestLoadBundle" var="bundle"/> ... <h:outputText value="#{bundle['todayString']}"/> |
|||
© 2010 TeamDev Ltd. | ![]() |