How to populate list dynamically?

Showing Answers 1 - 26 of 26 Answers

narasimha reddy

  • May 20th, 2006
 

add_list_element('listname',indexnumber,<item to be added in to the list>,<value of the item>);

subha

  • Jun 27th, 2006
 

I want to make two lists in an oracle form. Each list will be holding three elements. These elements are same for two lists. If one element is selected in one list , that will not come in the other list. That means the other list will show only two elements. How can I do that dynamically ?

Jagannatha Prasad Dash

  • Dec 7th, 2006
 

I want solution for for my forms. I have two columns. In one I want to store Thickner_Number & in the other I want to store list of Pumps. The pump list should vary as per the Thickner_Number selected.

 

Pl. help.

  Was this answer useful?  Yes

g_sidhu

  • Feb 15th, 2008
 

ADD_LIST_ELEMENT : Adds a single element to a list item. Add_List_Element(list_name VARCHAR2, list_index, NUMBER,list_label VARCHAR2, list_value VARCHAR2);

dornalpr

  • Jun 1st, 2011
 

create a procedure in program unit:

Procedure P_POPULATE_LIST(P_LIST_FIELD VARCHAR2, P_SQL VARCHAR2) IS
    group_id     RecordGroup;
    list_id      Item := Find_Item(P_LIST_FIELD); 
    status       NUMBER;
   BEGIN
          group_id := find_group('list'); 
        if not id_null(group_id) then
          delete_group(group_id);
        end if;
          group_id := Create_Group_From_Query('list',P_SQL);
          status := Populate_Group(group_id);
          Populate_List(list_id,group_id);
   END;

--------------------------------------

Call this in a trigger at what instance you want to populate the values.
1st parameter: item name - 'BLOCK.ITEM',
2nd parameter: Select query which gives the list item values - this select command should have 2 columns - one to show to user, other to store in back end (similar to list elements in property pallette). If you want to use same name for showing to user and back end storing then select same column twice.

ex: select emp_id, emp_id from emp;

------------------------------------------------------------

This way, you can populate values dynamically at any istance.

  Was this answer useful?  Yes

Create this procedure first:

PROCEDURE Pop_List IS

/*
** Built-in: CREATE_GROUP_FROM_QUERY
**Example: Create a record group from a query, and populate it.
*/

list_id ITEM;
list_name VARCHAR2(40) := 'BLOCK3.item';
rg_name VARCHAR2(40) := 'Employee_Names';
rg_id RecordGroup;
errcode NUMBER;
outcome NUMBER;
BEGIN
/*
** Make sure group doesn't already exist
*/
list_id :=Find_Item(list_name);
rg_id := Find_Group( rg_name );
/*
** If it does not exist, create it and add the two
** necessary columns to it.
*/
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query( rg_name,'SELECT ENAME,ENAME FROM EMP',FORM_SCOPE,200);
END IF;
IF Not Id_Null(rg_id) THEN
delete_group(rg_id);
rg_id := Create_Group_From_Query( rg_name,'SELECT ENAME,ENAME FROM EMP',FORM_SCOPE,200);

END IF;
/*
** Populate the record group
*/
errcode := Populate_Group_with_query( rg_id,'SELECT ENAME,ENAME FROM EMP' );
IF errcode = 0 THEN
outcome := GET_GROUP_ROW_COUNT(rg_id);
Message(outcome);
END IF;


Clear_List(list_id);
Populate_List(list_id,rg_id);

END;

  Was this answer useful?  Yes

Sudipta Santra

  • Oct 13th, 2011
 

First: check through Get_List_Element built_ins method that the both list has been selected with the value or not? if none is selected then all values should be populated .

Second: Declare a varray and then with loop u fill up the rest values(other than one list's selected value) in this varray. Then delete_list_element built_ins delete the other list's all values, then freshly add the elements with add_list_eliment with this for loop.

Thrid: Put this first trick into pre-popup-list trigger and the second trick into when-list-changed trigger.

  Was this answer useful?  Yes

deepak

  • Jul 15th, 2017
 

Will you provide me the code for populating list
as I am sending to you my parameter
record group= country_name
item=:country.c_name
there is block name= table name and item name = column name

  Was this answer useful?  Yes

deepak

  • Jul 15th, 2017
 

I just use this code
but it is showing error - no list element defined for list item

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions