Home » Developer & Programmer » Forms » re-populating poplist problem??
re-populating poplist problem?? [message #153655] Tue, 03 January 2006 10:11 Go to next message
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,
Re: re-populating poplist problem?? [message #153724 is a reply to message #153655] Tue, 03 January 2006 21:07 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You are probably addressing the wrong block, "populate_list('CITY_NAME',rg_id);" should contain the block as well as item name.

David

[Updated on: Tue, 03 January 2006 22:24]

Report message to a moderator

icon13.gif  Re: re-populating poplist problem?? [message #153877 is a reply to message #153655] Wed, 04 January 2006 10:13 Go to previous message
vakkalan
Messages: 20
Registered: January 2006
Location: US
Junior Member

ramisy2k,
I am not sure if you can populate a LIST once you are already in the form. Meaning the poplist only gets dynamically populated when you open the form.

I have not encountoured doing this way, but may be the workaround could be a stacked canvas based on another block which may be navigated on request????

This is very possible if you know the concept of frames in HTML. One of the pitfalls of using forms i guess.

HARSHA VAKKALANKA
Previous Topic: DELETE using CHECKBOX
Next Topic: form listener servlet
Goto Forum:
  


Current Time: Fri Sep 20 06:37:02 CDT 2024