You can create a form that allows a user to enter information for a new record and then commit that record into the data source. While you can choose to use the default ADF Form and then drop the Create operation as a command button, when this type of form is first rendered, it displays the data for the first instance in the collection.
The ADF Creation form allows users to create new instances in the collection without first displaying existing instances, this scenario might be very simple but the new developers find difficulty in creating empty ADF Input Form when page loads for the first time.
You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11.1.2.2.0 + HR Schema]
Implementation Steps:-
Create Fusion web application with Business Components from Tables based on Department table. In view controller project create a jspx page then drag and drop DepartmentsView1->Form as ADF Form as shown in below image.
Go to page bindings, in Bindings section click on create control binding and select action item. In create action binding wizard select AppModuleDataControl->DepartmentsView1->Operation->createInsert.
In Executables section click in create executables Binding and select invokeAction item. In Insert invokeAction wizard and follow as shown in below image.
The ADF Creation form allows users to create new instances in the collection without first displaying existing instances, this scenario might be very simple but the new developers find difficulty in creating empty ADF Input Form when page loads for the first time.
You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11.1.2.2.0 + HR Schema]
Implementation Steps:-
Create Fusion web application with Business Components from Tables based on Department table. In view controller project create a jspx page then drag and drop DepartmentsView1->Form as ADF Form as shown in below image.
Go to page bindings, in Bindings section click on create control binding and select action item. In create action binding wizard select AppModuleDataControl->DepartmentsView1->Operation->createInsert.
Edit the invokeCreateInsert and set the refresh to renderModel because when ever the page loaded this will execute the createInsert operation by inserting the empty record in the collection.
Run the jspx page and the web page will loaded with empty record.





good job deepak...keep on posting......
ReplyDeleteIt is a good article. I am very new to ADF and not able to finish your solution. I am using JDeveloper 11.1.1.6.0. In this did not find page bindings-->control bindings... Can you please elaborate on how to find page bindings. If you can, Please post screen shot of it. Thanks in advance.
ReplyDeleteRegards,
Raghu
Hi,
DeleteYou can find the Bindings tab on the same page in down section otherwise right click on the page and select "Go to Page Definition" will leads to Page Data Binding Definition page.
- Deepak
thanks for your information. Got it.
DeleteCan we do it for master-detail tables and also for the tables if we have multiple joins?
ReplyDeleteHi,
DeleteIn master-detail tables also you can achieve the above scenario.
- Deepak
Hi Deepak,
ReplyDeleteThanks for sharing this article. In my form there are 2 fields and that are password and confirm password. Whenever these two matches, on click of commit it inserts the record in the data base(This is working fine). But if these two are not matches, it throws appropriate error and disabling the commit button. How can I enable commit button in the above error scenario.
Regards,
Raghu
Hi Raghu,
DeleteSorry for the late reply.
Remove Disabled attribute value #{!bindings.Commit.enabled} for commit button, this make commit button enabled always.
-Deepak