Home » Developer & Programmer » Forms » re-populate list with updated values (dev6i, 11g, windows)
re-populate list with updated values [message #420886] Thu, 03 September 2009 01:03 Go to next message
annu-agi
Messages: 238
Registered: July 2005
Location: Karachi
Senior Member

hi experts,


I have stuck in one problem please guide me to out of this.
well i have a form where on i declare some populate list item in WHEN_NEW_FORM_INSTANCE trigger
the coding is like that
declare
   rg_name1   VARCHAR2 (40) := 'occurance_group';
   rg_id1     RecordGroup;
   errcode1   NUMBER;
   It_Id1     Item;
   tp_whr     varchar2 (2)  := ' / ';
begin
   rg_id1 := Find_Group (rg_name1);
   IF Id_Null (rg_id1) THEN
      rg_id1 :=
         Create_Group_From_Query
                (rg_name1,
                 'select event_occurance_heading ||'
                 || chr (39)
                 || tp_whr
                 || chr (39)
                 || '||event_occurance_type, to_char(event_occurance_id) into '
                 || ':event_mst.event_occurance_type from event_occurance_mst');
   End if;
   errcode1 := Populate_Group (rg_id1);
   It_Id1 := find_item ('event_mst.event_occurance_type');
   Populate_List (It_Id1, rg_id1);
   execute_query;
end;


now you can see i make one list item on form and populate it programatically.
it runs successfully with no issues. i can select items from list and update my form. if i want to update my list with some more items, missing from this populated list. for that i have one more form which directly input in the master table of corrusponding table of the list query. for that i made one button which run new form and enable me to input and update records and exiting from this form get back to me at populated list item ..
now i would like to see my populated list item with updated data.
see the code below for WHEN_BUTTON_PRESS
declare
   rg_name1   VARCHAR2 (40) := 'occurance_group';
   rg_id1     RecordGroup;
   errcode1   NUMBER;
   It_Id1     Item;
   tp_whr     varchar2 (2)  := ' / ';
BEGIN
   CALL_FORM ('k:\forms\event_occurance_mst.fmx', no_hide, no_replace,
              NO_query_only);
   rg_id1 := Find_Group (rg_name1);
   IF not Id_Null (rg_id1) THEN
      Delete_Group (rg_id1);
   end if;
   rg_id1 := Find_Group (rg_name1);
   IF Id_Null (rg_id1) THEN
      :event_mst.event_occurance_type := null;
      rg_id1 :=
         Create_Group_From_Query
                (rg_name1,
                 'select event_occurance_heading ||'
                 || chr (39)
                 || tp_whr
                 || chr (39)
                 || '||event_occurance_type, to_char(event_occurance_id) into '
                 || ':event_mst.event_occurance_type from event_occurance_mst');
   End if;
   errcode1 := Populate_Group (rg_id1);
   It_Id1 := find_item ('event_mst.event_occurance_type');
   Populate_List (It_Id1, rg_id1);
END;


Now the problem is when i run this form everything is run fine and list populated with item for the first time. but when i add new records in the corrusponding list query table and get back to form it wont be update .. while you can see i use delete_group too .. but it wont work ..
any idea ..
how can i update or re-populate my list item .

regards

Annu
[EDITED by DJM: formatted the code and removed superfluous blank lines]

[Updated on: Mon, 21 September 2009 23:51] by Moderator

Report message to a moderator

Re: re-populate list with updated values [message #421978 is a reply to message #420886] Sat, 12 September 2009 11:11 Go to previous messageGo to next message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
my first reponse would be you did not commit the data before existing your called form and so your new rows were rolled back.

Good luck, Kevin
Re: re-populate list with updated values [message #423056 is a reply to message #420886] Mon, 21 September 2009 23:52 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Why don't you use regular a 'record_group' and LOV? It is a LOT less painful.

David
Previous Topic: Query-only mode form
Next Topic: call a hlp file from forms 10g
Goto Forum:
  


Current Time: Fri Sep 20 06:24:31 CDT 2024