populate_list for non database field [message #444159] |
Fri, 19 February 2010 00:05 |
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 |
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 #444817 is a reply to message #444159] |
Wed, 24 February 2010 05:52 |
cookiemonster
Messages: 13963 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 |
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 #445151 is a reply to message #444817] |
Fri, 26 February 2010 04:08 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
cookiemonster wrote on Wed, 24 February 2010 11:52You 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 #447114 is a reply to message #445278] |
Thu, 11 March 2010 23:03 |
|
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
|
|
|