Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating List Item

Status
Not open for further replies.

bilalch

Programmer
Sep 26, 2003
84
IR
hi dear frends
can any1 plz tell me how to populate a list item with data base values on tha form and to perform specific action on selecting the value from list.
 
Hello, i'm also searching how to fill a list item, and i've found this code: only in my program this doesn't work :s



First: Create a Program unit
called "build_call_type_list":

PROCEDURE build_call_type_list IS
group_id RecordGroup := Find_Group('RGDNUMBER');
list_id Item := Find_Item('EMPLOYEE.DNO');
BEGIN
IF Populate_Group(group_id) <> 0 THEN
MESSAGE('Unable to populate record group.');
RAISE Form_Trigger_Failure;
END IF;
Clear_List (list_id) ;
Populate_List(list_id, group_id);
END;

then create a trigger to call the procedure, for example: Create a new trigger at the Form level called &quot;WHEN-NEW-FORM-INSTANCE&quot;. This trigger will call the build_call_type_list procedure whenever the form is executed:

BEGIN
build_call_type_list;
END;

I hope this works in your program, let me know how this code works!! thx

GRTZ

 
This is how I would do it :


Declare

v_count number := 0;

Begin
clear_list ('name_bloc.name_list_item');

for i in (Select id, description from name_table) --you can put the condition 'where' after name_table--
loop

add_list_element ('name_bloc.name_list_item', v_count+1, i.description, i.id); --list_item, index, label, value--

end loop;

:name_bloc.name_list_item:= Get_List_Element_Value('name_bloc.name_list_item',1); --put the first value to the list

v_count := 0;

End;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top