re-populating poplist problem?? [message #153655] |
Tue, 03 January 2006 10:11 |
ramisy2k
Messages: 150 Registered: April 2005
|
Senior Member |
|
|
Hi
i am using the following code on the when-button-pressed trigger while moving from db-block1 to db block2 on my form..it populates the names of cities in the poplist which is also a db item in block2 based on the values in two columns (:block2.CITY_ID and :block2.COUNTRY_ID) of block2..it works fine..
the problem is that after executing the query, if I make a change in :block2.CITY_ID and :block2.COUNTRY_ID and save changes then the poplist is not populated according to the new values in :block2.CITY_ID and :block2.COUNTRY_ID...if I press F8 then still it doesnot populate..
It only works if i exit the form and the again run the form and click the button to move to block2..
I want the poplist to be repopulated every time there is update/insert occurs in the :block2.CITY_ID or :block2.COUNTRY_ID
here is the code i am using on w-b-p trigger to populate my poplist
declare
rg_name VARCHAR2(40) := 'CITY_NAME';
rg_id RecordGroup;
gc_id GroupColumn;
errcode number;
q1 varchar2(650) := 'SELECT '' ''||CITY_NAME CITY_NAME, CITY_ID FROM CITIES WHERE CITIES.CITY_ID = :block2.CITY_ID AND COUNTRY_ID = :block2.COUNTRY_ID';
begin
:system.message_level := 5;
rg_id := Find_Group(rg_name);
if not Id_Null(rg_id) then
Delete_Group(rg_id);
ELSE IF
Id_Null(rg_id) then
rg_id := Create_Group(rg_name);
gc_id := Add_Group_Column(rg_id, 'CITY_NAME',CHAR_COLUMN,40);
gc_id := Add_Group_Column(rg_id, 'CITY_ID', char_COLUMN,5);
end if;
errcode := Populate_Group_with_query(rg_id,q1);
populate_list('CITY_NAME',rg_id);
end if;
execute_query;
END;
regards,
|
|
|
|
|