ADF CRUD Cascaded LOVs

ADF Crud operation and cascaded lov’s

Use Case : This Demonstrates a simple Master Detail Table ADF 11g CRUD Operation, Create – Read – Update – Delete Student Record . Teachers Table are Master Data and Every Teacher has a set of Students under him. We will demonstrate how to add students, delete and update student Record without adding a ton of code. and also we will use Cascaded LOV (List of Values) that student can select his Study Programs based on Course he/she selects. In real life the use-case can be very much different. the idea is to keep the use-case simple

[youtube=http://www.youtube.com/watch?v=Zaom7tgBUeQ]

click on view in full screen icon on this youtube video

View All Students – Master Detail Relation

Create Students

Update Student ( also Delete )

database firewall exceptions

My Oracle Database 11gR2 is running on Fedora 16 Operating System. I was not able to connect from my JDeveloper which is running on Ubuntu 12.04 Machine. I was getting Test failed: IO Error: The Network Adapter could not establish the connection

This is a fire wall issue , all you need to do is go to database machine and run these commands
[oracle@james wc_domain]$ su
Password: ******
[root@james wc_domain]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@james wc_domain]# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]

If your JDeveloper is on Same Machine as Database you will not face this Error Massage
for details on Running DB on Oracle Enterprise Linux or Fedora look at this Blog Link

Cascaded lov and select many choice 

ADF makes life easier with LOVs (List of values) , create a view link between master and detail table. with the id that joins these 2 tables. test under App Module. from the data control Drag and Drop the Master as “SelectOneChoice” and Drag and Drop the detail table as “SelectManyChoice” if you want multiple details , or use “SelectOneChoice” if you wish to select only one value from the LOV.

View of Master Detail View Link in DataControl

View on JSPX Master Table (Course name) Drag n Dropped as SelectOneChoice, Detail Table (Programs) Drag n Drop as SelectManyChoice

Select Boxes have id and values

to access values you would need something like this

#{bindings.CoursesvoUpd2.attributeValue}

to access ids associated you would need this one

#{bindings.CoursesvoUpd2.inputValue}

For Details on CRUD refer the Previous Blog link

source code download

This PS5 version source code with Enhancements

1. Added LOVs

2. Demonstrates how to use setPropertyListener during Create Student

http://dl.dropbox.com/u/12614021/Lesson5_May28Upd_PS5.zip

Author

About Author