Question : Oracle forms 10g

Dear Expert,
                 i have a radio button and it has 3 values

if the button value = 'A1' then i have to populate the list item
with some set of values.and if it is 'A2' then other set of values then if it is 'A3' then i have to populate with other set of value.
The list item should dynamically populate the values.
Please help me.

Answer : Oracle forms 10g

The WHEN-RADIO-CHANGED trigger can be used to determine when the radio group  value has changed.  See the attached sample form for an example of how to change the list values, which I have coded using a program unit called build_list as follows:

Note: In my example, the build_list procedure takes a parameter from the radio group and it is this parameter that controls what data the select statement will retrieve.

Due to the restrictions on file name extensions enforced by Experts Exchange, the attached file has the extension jpg.  This needs to be changed to fmb to give LIST.fmb.  The form can then be opened in Oracle Forms Builder.
The form is based on the emp and dept demo tables provided by Oracle.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
PROCEDURE build_list (i_deptno in number) IS
	  rg_name  varchar2(40) := 'Employees'; 
	  rg_id    RecordGroup;
	  list_id  item := find_item('dept.emps');
	  errcode  number; 
	BEGIN
	  rg_id := find_group(rg_name); 
	  if not id_null(rg_id) then 
	    -- Record group exists - delete it before re-creating it
	    delete_group(rg_id);
	  end if;

	  -- Create the record group
	  rg_id := create_group_from_query(rg_name, 
	                            'select ename, to_char(empno) empno '||
	                              'from emp '||
	                              'where deptno = '||i_deptno );
	  	  
	  errcode := populate_group(rg_id);
	
	  if errcode != 0 then
	    message('Error occurred while populating group: '||errcode);
	  end if;
	
	  clear_list(list_id);
	  populate_list(list_id,rg_id);
END;
 
Sample Form - rename to LIST.fmb after saving
 
Random Solutions  
 
programming4us programming4us