Sun. Oct 24th, 2021

Requirement: I have a addProgDemo.jsf page. In that page I have three af:inputText and one af:button. Just for alignment purpose I have surrounded all three af:inputText and af:button inside a af:panelFormLayout.

The labels for the three af:inputText are: Country Id, Country Name, and Region Id, and the text for the af:button is Save. Now I will enter values in all these three af:inputText and then click the Save button. On click of Save button it should save the values in the Oracle database table.

Note: I have to achieve this functionality programmatically.

Solution: We will use the COUNTRIES table of Oracle database XE present in the HR schema. For solution of the above requirement follow the below steps:

Step 1: Create an Oracle ADF Fusion Web Application.

Step 2: Create an ADF Business Components from tables.The ADF Business Components should contain: AppModule, CountriesEO, and CountriesVO as shown below:

Step 3: Create a addProgDemo.jsf page in the ViewController project of our application created in Step 1. Drag and drop af:panelFormLayout. Now drag and drop three af:inputText and one af:button inside the af:panelFormLayout. Give the label names for the three af:inputText as Country Id, Country Name, and Region Id respectively. Also create the bindings for all these three af:inputText. Give the text name of the af:button as Save. Create an actionListener for this button. The detailed code for the addProgDemo.jsf page is shown below:

Step 4: Go to the binding tab of the addProgDemo.jsf page and create the Binding and Executables as shown below:

Step 5: Write the below codes in MyBean.java.

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

Step 7: Now we will enter values in the UI for Country Id, Country Name and Region Id as BN, Bangladesh, and 3 respectively. Before that I will verify that there is no record with Country Id as BN. To verify write the below query:

Now enter the above values in the addProgDemo.jsf and click on Save. Thus, the data get saved in the database.

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

 486 total views,  2 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 *

satta king chart