Re: How to get the element label in an List Item, Forms 4.5

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au.no_junk_today_thanks>
Date: 1998/03/18
Message-ID: <01bd5219$ed76fc60$45f11286_at_itwol-pc3963.itwol.bhp.com.au>#1/1


Jocke,

As you may already know from my previous posting, the reference to Get_List_Element_Value
should be Get_List_Element_Label.

There are also errors in the Forms example for Get_List_Element_Count, whereby list_id is undefined and the first loop should use Get_List_Element_Label.

I would suggest you do something similar to the following:

DECLARE
   list_id ITEM := Find_Item(your_block.list_item);    total_list_count NUMBER(2);

   loop_index_var   NUMBER(2) := 0; 
   list_value       VARCHAR(50); 
   list_label       VARCHAR(50); 

BEGIN
/*
** Determine the total number of list elements.
*/

   total_list_count := Get_List_Element_Count(list_id); /*
** Compare the current list item to the list element values.
*/

   WHILE loop_index_var < total_list_count     AND list_label = NULL
   LOOP

     loop_index_var := loop_index_var + 1; 
     list_value := Get_List_Element_Value(list_id, loop_index_var);
/*
** All list values are unique, so if it matches, get the Label.
*/
     IF your_block.list_item = list_value THEN 
       list_label := Get_List_Element_Label(list_id, loop_index_var); 
     END IF; 

   END LOOP;
/*

** If you want to access the label outside this procedure, save it
  • in a Control item or some other non-display item. */ Control_block.item := list_label; END;
Hope this is what you're looking for,
Neville Sweet <sweet.neville.nj_at_bhp.com.au.no_junk_today_thanks> Received on Wed Mar 18 1998 - 00:00:00 CET

Original text of this message