Wed. Aug 4th, 2021

Requirement: I have a demo.jsf page. In that page I have three af:outputText. I have a resourceBundle.properties where I have the values for all the three af:outputText. I want to set values to the af:outputText through bean, mean first I will get the resourceBundle.properties values in the java bean (MyBean) and from bean I will set the values to the three af:outputText in the demo.jsf page.

Please note: We can easily set the values to the three af:outputText directly without using the java bean, but there will be a scenarios where it is not advisable to do so. Thinking of those scenarios, I have posted this requirement and its solution.

Solution: For solution to the above requirement follow the below steps:

Step 1: Create an Oracle ADF Fusion Web Application.

Step 2: Create a demo.jsf page in the ViewController project of our application.

Step 3: Drag and drop three af:outputText from the component panel on the demo.jsf page. Please note I have also used one af:panelGroupLayout and two af:spacer, but these two components that is af:panelGroupLayout and af:spacer is just for alignment purpose, and nothing else.

Step 4: Create a resourceBundle.properties and put three key values pair as shown below. These three values I will be displaying in the demo.jsf through Java code.

Step 5: Create a backingBean named “MyBean” and write the below code:

Step 6: Set the values of the three af:outputText in the demo.jsf page as shown below. The value that each af:outputText is referring is defined in the MyBean code.

Step 7: Save all and run the application. Thus, the ran application is shown below.

Hence, the solution to our requirement.

If you like the post please comment, share, and do join me on Facebook. Please subscribe to my YouTube Channel for video tutorials.

Thanks & Regards,
Susanto Paul

 473 total views,  1 views today

By Susanto Paul

Susanto is an Oracle ACE, a qualified MCA, MBA, and a highly-skilled Senior Oracle Specialist. He is an enthusiastic Blogger and YouTuber who helps learners to solve their complex problems more efficiently. He has 9+ years of experience in multiple technologies like AWS, Oracle ADF, Oracle APEX, Oracle JET, Oracle VBCS, Oracle IDCS, Oracle PL/SQL, Oracle Integration Cloud, Java, JDBC, Servlets, JSP, Spring, Hibernate, HTML5, CSS3, JavaScript, TypeScript, NodesJS, Angular, MySQL, Oracle WebLogic Server, JUnit, JMeter, Selenium Web Driver, etc. He is a certified: Oracle Certified Professional Java SE 6 Programmer, Oracle ADF 11g Certified Implementation Specialist, Oracle Cloud Platform Application Integration 2020 Certified Specialist, Oracle Cloud Infrastructure Foundations 2020 Certified Associate, and Oracle Cloud Infrastructure Developer 2020 Certified Associate

Leave a Reply

Your email address will not be published. Required fields are marked *