Home » Developer & Programmer » Forms » How to add list items in run time
How to add list items in run time [message #173822] Wed, 24 May 2006 11:42 Go to next message
vikasg2006
Messages: 80
Registered: March 2006
Location: Dubai
Member
hy
can any body tell me how can we add list items in run time D2K
(5.0) . Means we cannot assign LIST ITEMS values using property
but can fetch from database and assign runtime? my code is attach below but it doesn't work

DECLARE
rg_id RecordGroup;
list_id Item;
v_query VARCHAR2(1000);
error NUMBER;
BEGIN

v_query := 'SELECT DEPTNO FROM DEPT';
rg_id := find_group ('TEST');
if ID_Null (rg_id) then
rg_id := create_group_from_query('TEST', v_query);
end if;
error := populate_group(rg_id);
list_id := Find_Item ('v_item');
clear_list (list_id);
populate_list (list_id, rg_id);
END;



vikas
Re: How to add list items in run time [message #174446 is a reply to message #173822] Mon, 29 May 2006 04:35 Go to previous messageGo to next message
gacki
Messages: 33
Registered: May 2006
Location: Dueren, NRW, Germany
Member
If you have a record group named "TEST" defined in your form then

If ID_Null (rg_id) then
always returns false, and your record group will be populated with the properties set at designtime, not at runtime.

Gerald
Re: How to add list items in run time [message #174528 is a reply to message #173822] Mon, 29 May 2006 08:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why not use a non-dynamic record_group?

David
Re: How to add list items in run time [message #174531 is a reply to message #173822] Mon, 29 May 2006 08:09 Go to previous messageGo to next message
vikasg2006
Messages: 80
Registered: March 2006
Location: Dubai
Member
hy Gerald
this is the problem which i face .when i run my form list item doesn't show values which i want to fetch from database(initial value display). now i want solution. is there any other way in d2k to fetch list items value in run time. any other way?

hy david
as u ask me why i am not using non-dynamic Record group.... the reason is we are working in huge data. for example if one static record group display this cities of india ...OK. it means it contains 100's of entries in which we have to select..OK now in case of dynamic RG i want to display only those cities having in rajasthan..OK got my point, it can faster the query when working on huge amount of data and remove un-necesssary values



thanks for reply
vikas

[Updated on: Mon, 29 May 2006 08:14]

Report message to a moderator

Re: How to add list items in run time [message #174543 is a reply to message #174531] Mon, 29 May 2006 08:27 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use the same record_group but use the long version of the LOV.

David
Re: How to add list items in run time [message #174613 is a reply to message #174446] Tue, 30 May 2006 01:40 Go to previous messageGo to next message
vikasg2006
Messages: 80
Registered: March 2006
Location: Dubai
Member
gacki wrote on Mon, 29 May 2006 04:35

If you have a record group named "TEST" defined in your form then

If ID_Null (rg_id) then
always returns false, and your record group will be populated with the properties set at designtime, not at runtime.

Gerald



To : Mr Gerald,

No, i have not create any recored group named 'TEST'.

but same this process are working on form 9i, so will u please tell me,is this codes workes on form 4.5?

Regards

Vikash
Re: How to add list items in run time [message #174700 is a reply to message #174613] Tue, 30 May 2006 06:26 Go to previous messageGo to next message
gacki
Messages: 33
Registered: May 2006
Location: Dueren, NRW, Germany
Member
I'm totally confused: you talk about D2K (5.0), then you say it works in 9i and now you ask if it works in 4.5.........

I have no experience with 4.5, only 6i web, 9i and 10g.

Where have you placed your code (trigger?), and why do you think it doesn't work?

Gerald
Re: How to add list items in run time [message #174971 is a reply to message #173822] Wed, 31 May 2006 04:58 Go to previous messageGo to next message
vikasg2006
Messages: 80
Registered: March 2006
Location: Dubai
Member
hy
i am using forms 4.5(or 5 its same). i m put my code in one button and there is one list item name v_item ok. when i click on button the list item does not populate as per the query which i write inside button. there is no record group. we have to create at run time
vikas
Re: How to add list items in run time [message #174973 is a reply to message #174971] Wed, 31 May 2006 05:05 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
vikasg2006 wrote on Wed, 31 May 2006 11:58

i am using forms 4.5(or 5 its same)
No it is most definitely NOT. Forms 5 (developer/2000 R2 if you will) introduced quite a few new features.

MHE
Re: How to add list items in run time [message #175166 is a reply to message #174973] Thu, 01 June 2006 02:46 Go to previous messageGo to next message
gacki
Messages: 33
Registered: May 2006
Location: Dueren, NRW, Germany
Member
The query must have at least two columns of type varchar2, so use "select name,to_char(deptno) from dept". NAME will be the label, DEPTNO the value of the list item.

Gerald
Re: How to add list items in run time [message #175203 is a reply to message #175166] Thu, 01 June 2006 04:41 Go to previous message
lomhanz
Messages: 18
Registered: May 2005
Location: Cebu, Philippines
Junior Member

hello,

gerald is right, a list must have a label column and a value column. so make sure that in your query, you have this 2 must columns.

good luck.

thanks..lomhanz
Previous Topic: Percentage
Next Topic: Locking Table for Update in Forms
Goto Forum:
  


Current Time: Fri Sep 20 09:55:51 CDT 2024