Home » Developer & Programmer » Forms » Dynamically populate 2nd drop down list based on the 1st list value (4.5)
Dynamically populate 2nd drop down list based on the 1st list value [message #306376] Fri, 14 March 2008 00:00 Go to next message
D_ashish
Messages: 20
Registered: November 2007
Location: india
Junior Member
Hi All,

Im trying to populate list based on selected value in first list ...like dept in first then in secomd list all employee whos belong to that department would pop up....


i hav written code on first list WHEN ITEM CHANGED
DECLARE


group_id RecordGroup;
list_id Item := Find_Item('MYBLOCK.EMPLIST');
status NUMBER;
rg_name varchar2(40) := 'recgroup';

BEGIN


clear_list(list_id);
group_id := Find_Group(rg_name);
IF NOT id_null(group_id) then
Delete_Group(group_id);
End if;
group_id := Create_Group_From_Query(rg_name,'SELECT ENAME,ENAME FROM EMP WHERE dept=:MYBLOCK.DEPTLIST');

status := Populate_Group(rg_name);
Populate_List(list_id, group_id);

END;

but its not working

Any clues.....

Thanks
Ashish D


Re: Dynamically populate 2nd drop down list based on the 1st list value [message #306473 is a reply to message #306376] Fri, 14 March 2008 07:38 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
You may write the code in the trigger when-list-changed.
Also the code should be
group_id := Create_Group_From_Query(rg_name,'SELECT ENAME,ENAME FROM EMP WHERE dept='||:MYBLOCK.DEPTLIST);
By
Vamsi
Previous Topic: bind variable
Next Topic: What is this message?
Goto Forum:
  


Current Time: Fri Dec 09 01:56:39 CST 2016

Total time taken to generate the page: 0.05119 seconds