Home » Developer & Programmer » Forms » ...List Item problem.. want to add element dynamically..not working
...List Item problem.. want to add element dynamically..not working [message #137320] Wed, 14 September 2005 11:36 Go to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
HI....
I want to populate list T List with the values from the database

I want that whenever user select a date, all the record with that date is displayed in the T list from which user can select and click on the record and that record will displayed in the Fields .


I have created a list and a recordgroup

recgroup:= create_group_from _query('gname','select createtime,st_long from cc_hist where stid like %1063')

and then i use

status is a number variable

status:= populate_group('gname');

Now i user

Populate_list( listname,gname) where gname is the record group name.

but this procedure is not working

then i use

Recgroup varchar2(100);

Recgoup:='select ......... query)

then

Populate_list('listname',recgroupname)..

No error is shown rather i recieve a message in the task bar of Forms 6i

that " Module built succesfully"

But not a single item is shown in the T List..

why is this..

Is there any other way to popluate the list
i want ot show at least 2 or 3 columns in the same list is it possible..

Kindly reply urgent...


Thanx alot ..


best regards
Re: ...List Item problem.. want to add element dynamically..not working [message #137368 is a reply to message #137320] Wed, 14 September 2005 20:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why do you guys (a gender neutral term, by the way) always use DYNAMIC record_groups? Why not use the record_groups that exist in the form? Try creating your record_group in the form, base your List on it and then see if it works.

Alternatively, search this forum for 'record_group' and 'record group'.

David
Re: ...List Item problem.. want to add element dynamically..not working [message #137396 is a reply to message #137320] Thu, 15 September 2005 01:38 Go to previous messageGo to next message
orcl_dba
Messages: 84
Registered: March 2005
Member
thanx alot david but i think i m totally not getting you ..
You r rite i dont need to create a dynamic record group but only because my record group would be based on certain condition..
i dont want to create record groups for each condition. rather it is good idea to dynamically create them and then delete them isnt it ....

this is minor issue

The main issue is that ..

here is the code i m using ..

............................................

declare
--listid item:=List_item('List6');
	rg Recordgroup;
	pop number;
begin
	--Add_list_Element('List6',1,'Hi','first');

	rg:= Create_Group_From_Query('rcg','select st_city,to_char(st_cit) from site');

	pop:=Populate_Group('rcg');
	
	Populate_list('List6','rg');
	
--	clear_list('List6');
end;

........................................

well i have searched and found that if you create groups to populate item in the list box.. you need to add extra column for the value of the list item.. for each element.

thats what i tried to do. but still i get the error.

FRM41072 etc that cannot create record group..

i dont know what the hell is the error..

Kindly tell me How to populate my list..

its an imp module and user will select stid and i will create group based on that stid and then populate result in a list item.. T list..

Kindly reply me urgent so that at least i know how to do this..

best regards

thanx alot...

[Updated on: Thu, 15 September 2005 01:48] by Moderator

Report message to a moderator

Re: ...List Item problem.. want to add element dynamically..not working [message #137399 is a reply to message #137396] Thu, 15 September 2005 01:55 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
The documentation has the following example
/*
** Built-in: CREATE_GROUP_FROM_QUERY
** Example: Create a record group from a query, and populate it.
*/

DECLARE
   rg_name   VARCHAR2 (40) := 'Salary_Range';
   rg_id     RecordGroup;
   errcode   NUMBER;
BEGIN
/*
** Make sure group doesn't already exist
*/
   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 SAL-MOD(SAL,1000) BASE_SAL_RANGE,'
                                  || 'COUNT(EMPNO) EMPS_IN_RANGE '
                                  || 'FROM EMP '
                                  || 'GROUP BY SAL-MOD(SAL,1000) '
                                  || 'ORDER BY 1');
   END IF;

/*
** Populate the record group
*/
   errcode  := Populate_Group (rg_id);
END;
Does this help?

David

PS Please limit usage of IM speak and txt.tlk - it is very hard to read.

[Updated on: Thu, 15 September 2005 01:57]

Report message to a moderator

Previous Topic: got problem handling error
Next Topic: copying project from one drive to other doesn't work
Goto Forum:
  


Current Time: Fri Sep 20 00:25:47 CDT 2024