This discussion is archived
6 Replies Latest reply: Oct 14, 2013 9:34 PM by rainy4200 RSS

Dependent drop down lists in forms 6i

Soni Newbie
Currently Being Moderated
Hi to all.

Is there any doc are example how to implement dipendend drop down list in oracle form 6i.
Ii have searched the web with no success.

Thank you in advance

Soni
  • 1. Re: Dependent drop down lists in forms 6i
    Amatu Allah Guru
    Currently Being Moderated
    Hi Soni
    have searched the web with no success.
    i dis-agree with u in this :)

    Any way pls. try the following...

    /* WHEN-NEW-FORM-INSTANCE Trigger*/

    DECLARE
     
    rg_countries RECORDGROUP;
     
    rg_name VARCHAR2(40) := 'country';
     
    vTemp NUMBER;
     
    BEGIN
     
    -- Pls make sure Group doesn't already exist
     
    rg_countries  := FIND_GROUP(rg_name);
     
    -- If it doesn't exist then create it and add ur query to it
     
    IF Id_Null (rg_countries) THEN
     
    rg_countries:=CREATE_GROUP_FROM_QUERY(rg_name , 
    'SELECT country_name NAME, COUNTRY_ID VALUE FROM COUNTRY ORDER BY 2');
     
    --Populate the Record Group
     
    vTemp:=POPULATE_GROUP(rg_countries);
     
    POPULATE_LIST('BLOCK3.COUNTRIES', rg_name);
     
    END;
     
     
    Hope this helps...

    Regards,

    Abdetu...
  • 2. Re: Dependent drop down lists in forms 6i
    Soni Newbie
    Currently Being Moderated
    Thank you for your response.

    The problem is when you have 2 drop down lists.

    Drop down list 2 depends on the value that it is selected in Drop down list 1

    somehow on list changed of Drop down list 1 i want the Drop down list 2 to be filtered.

    can you provide some example on this please.

    kind regards,

    Soni
  • 3. Re: Dependent drop down lists in forms 6i
    Amatu Allah Guru
    Currently Being Moderated
    yesss...

    and well tested also :) Supposed i have 1st list the DNAME and the following example will display the emp_name

    -- for the Second list here u have to get the e.g. DEPTNO

    -- in order to be changed according to the first list-item selection of e.g. DNAME

    In When-List-Changed of the Firsr List Say the Dept_List u have to write the following code...

    BEGIN
    SELECT DEPTNO
    INTO :DEPTNO
    FROM DEPT
    WHERE DNAME = :DNAME;
     
    EXCEPTION
     
    WHEN NO_DATA_FOUND THEN NULL;
     
    WHEN OTHERS THEN (ERRTXT);
     
    END;
     
    -- Here u make the list DNAME changed accordingly depending on the DNAME list selection & filtered by the deptno...
     
    DECLARE
     
    rg_city RECORDGROUP;
     
    rg_name VARCHAR2(40) := 'EMP';
     
    list_id Item := Find_Item('EMP.ENAME');
     
    vTemp NUMBER;
     
    BEGIN
     
    -- Pls make sure Group doesn't already exist
     
    rg_city  := FIND_GROUP(rg_name);
     
    IF NOT id_null(rg_city) then
    Delete_Group(rg_name);
     
    End if;
     
     
    -- If it doesn't exist then create it and add ur query to it
     
    rg_city :=CREATE_GROUP_FROM_QUERY(rg_name , 'SELECT ENAME , ENAME FROM EMP WHERE EMP.DEPTNO = '|| :DEPT.DEPTNO);
     
    SET_RECORD_PROPERTY(:system.cursor_record,'EMP',status,new_status);
     
     
    vTemp:=POPULATE_GROUP(rg_name);
     
     
     POPULATE_LIST('EMP.ENAME', rg_name); 
     
     
    END;
     
    Regards,

    Abdetu...

    Edited by: Abdetu on Mar 8, 2011 4:41 AM
  • 4. Re: Dependent drop down lists in forms 6i
    Soni Newbie
    Currently Being Moderated
    Thank you.

    you solved my problem

    Kind regards,

    Soni
  • 5. Re: Dependent drop down lists in forms 6i
    Amatu Allah Guru
    Currently Being Moderated
    u most Welcomed :)

    But pls mark the outer link also for both which will be added to Answered Questions and for Users Who might face the same problem

    Best Regards,

    Abdetu...
  • 6. Re: Dependent drop down lists in forms 6i
    rainy4200 Newbie
    Currently Being Moderated

    hello,

    but this process is not update the data of database only insert the new item.what should i do if i want to update the value of database from the list.

    thanks in advance.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points