Home » Developer & Programmer » Forms » populate_list for non database field (oracle forms 10g)
populate_list for non database field [message #444159] Fri, 19 February 2010 00:05 Go to next message
rakesh1901
Messages: 12
Registered: November 2007
Location: Vadodara,India
Junior Member
Hello,
in my forms,1 block(multi record)) which has 5 database columns(c1,c2,c3,c4,c5) and 1 non-database column(s1).
Forms shows column c4 ans s1.
I use populate_list on s1 column on basis of value c1,c2,c3 using system.mouse_record to fetch respective record values in the list.

but getting problem of list pop up size and return value on selecting value from pop up list.
means clicking on 1st record and selecting value(e.g val1),its return "val1" .
after that clicking on 2nd record and selecting value(e.g xyz),its return "xyz" but at that time 1st record value become "xyz" instead of "val1".
mns its replace all values with current selected value from the list.

Original code for reference as below.
---------------------------------------
PROCEDURE S_VALUE_LIST IS
	rg_id RecordGroup;
	lst_id Item := Find_Item('SNSPECMST.S_VALUE');
	ERRORCD NUMBER;
	t_srno1 number := 0;
	t_srno2 number := 0;
	t_srno3 number := 0;
BEGIN
	-------------------------------------------------------------
declare cursor c1 is 
	select specmst_srno1,specmst_srno2,specmst_srno3 
	  from snspecmst
	 where specmst_prod_type = :SNITEMS.SI_PROD_TYPE
	   and rownum < (to_number(:SYSTEM.MOUSE_RECORD) + 1)
	  order by rownum desc;
begin
open c1;
loop
	fetch c1 into t_srno1,t_srno2,t_srno3;
	exit when c1%notfound;
	exit;
end loop;
close c1;	
end;

rg_id := Find_Group('vs'); 
IF NOT Id_Null(rg_id) THEN 
	Delete_Group( rg_id ); 
END IF;
clear_list(lst_id);
rg_id := Create_Group_From_Query('vs', 'SELECT ECS_VAL, ECS_VAL   FROM ECS_SPECVAL WHERE ECS_PROD_TYPE = '||CHR(39)||:SNITEMS.SI_PROD_TYPE||CHR(39)||' AND ECS_SPEC_SRNO1 = '||t_SRNO1 ||' AND ECS_SPEC_SRNO2 = '||t_SRNO2 || ' AND ECS_SPEC_SRNO3 = '||t_SRNO3 ||' ');

ERRORCD := Populate_Group(rg_id);
if ERRORCD = 0 THEN
	populate_list(lst_id,rg_id);
ELSE
	G_FUN.MSGBOX('Error in creating list items');
	raise form_trigger_failure;
end if;
delete_group('vs');
END;
----------------------------------


So please help to resolve this issue.
Thanking you.




CM: Added code tags, please do so yourself next time - see the orafaq forum guide if you're not sure how.

[Updated on: Fri, 19 February 2010 03:56] by Moderator

Report message to a moderator

Re: populate_list for non database field [message #444301 is a reply to message #444159] Sat, 20 February 2010 06:16 Go to previous messageGo to next message
meena.g
Messages: 14
Registered: February 2010
Location: Hyderabad (A.P)
Junior Member
hi....
try this one in loop condition


.....
...
...
....
begin
create_record;
first_record;

open c1;
loop
fetch c1 into t_srno1,t_srno2,t_srno3;
exit when c1%notfound;
exit;
end loop;
close c1;
next_record;
end;
....
....
....

Re: populate_list for non database field [message #444429 is a reply to message #444301] Sun, 21 February 2010 23:33 Go to previous messageGo to next message
rakesh1901
Messages: 12
Registered: November 2007
Location: Vadodara,India
Junior Member
getting msg "frm-40102:Record must be entered or deleted first."
and list doesn't popup.
Re: populate_list for non database field [message #444436 is a reply to message #444301] Mon, 22 February 2010 00:38 Go to previous messageGo to next message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
Dear,

From where u called
PROCEDURE S_VALUE_LIST IS
procedure? u can call this procedure WHEN-NEW-RECORD-INSTANCE trigger.


Regards,
Tamzidul Amin.
Re: populate_list for non database field [message #444778 is a reply to message #444436] Wed, 24 February 2010 02:47 Go to previous messageGo to next message
rakesh1901
Messages: 12
Registered: November 2007
Location: Vadodara,India
Junior Member
i called this procedure in when-mouse-click on S1 field.
jst tried soluction given by u but prob still remain same.
Re: populate_list for non database field [message #444817 is a reply to message #444159] Wed, 24 February 2010 05:52 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
You can't do what you are trying to do.
The values for a given list item are replicated for all records in a block. You change one you change all.
You'd be better off using a text item and an LOV. You can write the LOV query so that the data it displays is based on the values selected in the other items in the current record.
Re: populate_list for non database field [message #445108 is a reply to message #444778] Thu, 25 February 2010 22:56 Go to previous messageGo to next message
meena.g
Messages: 14
Registered: February 2010
Location: Hyderabad (A.P)
Junior Member
Hi,

can u try this one.like item_name if you are using list item then
if :block_name.listitem_name = 'val1' then (val1 is is a list item value )
.....
....
.....
elsif :block_name.item_name = 'xyz' then
.........
........
..........
else
....
end if.
Re: populate_list for non database field [message #445136 is a reply to message #445108] Fri, 26 February 2010 02:56 Go to previous messageGo to next message
rakesh1901
Messages: 12
Registered: November 2007
Location: Vadodara,India
Junior Member
if i select value from popup list then it shows me in the field because of "Create_Group_From_Query".
so no need of checking and assigning value like :block_nm.field_nm.
Re: populate_list for non database field [message #445151 is a reply to message #444817] Fri, 26 February 2010 04:08 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Wed, 24 February 2010 11:52
You can't do what you are trying to do.
The values for a given list item are replicated for all records in a block. You change one you change all.
You'd be better off using a text item and an LOV. You can write the LOV query so that the data it displays is based on the values selected in the other items in the current record.


What part of that did you not understand?
Re: populate_list for non database field [message #445265 is a reply to message #445151] Fri, 26 February 2010 21:33 Go to previous messageGo to next message
rakesh1901
Messages: 12
Registered: November 2007
Location: Vadodara,India
Junior Member
my requirement is to use listbox ,not a text field and LOV.
Re: populate_list for non database field [message #445278 is a reply to message #444159] Sat, 27 February 2010 13:13 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
That in no way changes the fact that you can't do what you are trying to do.
Re: populate_list for non database field [message #447114 is a reply to message #445278] Thu, 11 March 2010 23:03 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry that I have been so long in replying. Have you solved your problem?

Using standard 'record_groups' and LOVs would get arounf all these problems. Just refence the previous item in the 'next' 'record_group'.

David
Previous Topic: Open word which is stored in database. And Re-store the modified file in the database
Next Topic: Oracle 10g Developer suite installation problem
Goto Forum:
  


Current Time: Fri Sep 20 06:40:28 CDT 2024