Populating lists in FORMS

From: sdenney <sdenney_at_healthetech.com>
Date: Fri, 16 Feb 2001 14:47:47 -0800
Message-ID: <3F4B7413A49AC2C1.29DD0DD4D90C7813.EF4E0410DB2060A2_at_lp.airnews.net>


The following is a when_new_form_instance trigger used to populate two combo box list items(foodgroup and category)

BEGIN
get_list_values('foodgroup', 'foodgroups', 'name'); get_list_values('category', 'categories', 'name'); END; These use the following two procedures.




PROCEDURE get_list_values(list_name varchar2, table_name varchar2, col_name varchar2 ) IS

list_id item;
sql_stat varchar2(2000);

BEGIN
   sql_stat := 'SELECT DISTINCT '||col_name||' , '||col_name||' FROM ' || table_name||' ORDER BY 1';

   populate_the_list(list_id, sql_stat); END;




PROCEDURE populate_the_list(list_id item, sql_stat varchar2) IS

group_id recordgroup;
outcome NUMBER;
BEGIN
  message(sql_stat);
  group_id := CREATE_GROUP_FROM_QUERY('list_elements', sql_stat   outcome := POPULATE_GROUP(group_id);
  populate_list(list_id, group_id);
  DELETE_GROUP(group_id
END;



I simply can not get the second one to work and I don't know why. The first one works. Is there some restriction on doing this twice? both list items have 1 'element in list ' with the value null. Any help would be appreciated. Maybe there is a more simple way that I am overlooking? Received on Fri Feb 16 2001 - 23:47:47 CET

Original text of this message