Skip to main content

Posts

Showing posts with the label Resource bundle

ADF 11g Quicky : Select text from a resourcebundle

One of the questions I got lately is how to select a specific text from a resource bundle and use it in an ADF Application. This is easy and can be done as shown below. All you need is a resourcebundle containing the keys and text values, a selectcomponent to set the actual key and some java code in a valueChangeListener to search the resourcebundle for the key. So first create the resourceBundle file to hold the key/value pairs for the text resources. Next implement the page holding the selectcomponent, and an output component to show the value retrieved from the resourcebundle. 1: <af:panelGroupLayout id="pgl1"> 2: <af:selectOneChoice valueChangeListener="#{pageFlowScope.resourceBundleManager.listEntryChanged}" 3: id="soc1" autoSubmit="true" valuePassThru="true" 4: label="#{viewcontrollerBundle.SEL_RESOURCE_KEY}"> 5: <af:selectItem label="Value 1" val...

ADF 11g : Label Modifications and Persisting Resource Bundle Changes

In a comment on one of my posts on the AMIS technology blog I had a question on UIComponents. The question was if it is possible to modify prompts and labels of components programmatically. As a matter of fact this is possible. You can do this for the session only, or you can choose to persist these changes. In this post I first explain how to implement the "session only" functionality, and in the second part I explain how to use a persisted resource bundle with immediate refresh. Application Setup The application used in this post is based on the HR schema and the business components are created and not changed. First of all you create a page that is used to hold components of which you want to change labels and prompts. Create two panelboxes next to each other. In the first one drop the employees collection and in the second one drop the child employees collection. Drop both as read only form. When browsing the first box, the second one will show the subordinate employees ...