Re: Oracle forms 6i: Dynamic LOV Column Mapping

From: Eric J. Givler <ericjgivler_at_earthlink.net>
Date: Sat, 27 Apr 2002 02:06:32 GMT
Message-ID: <IIny8.7371$iU4.629080_at_newsread2.prod.itd.earthlink.net>


Map the return items to :GLOBAL.ITEM1, :GLOBAL.ITEM2, etc. (as many as you need).

Prior to using the list of values, create an association (ie. global.item1 will go into what form block.item). Then recode your list of values so that once the lov is displayed and something is selected. Something like the following (which I just made up):

key-listval trigger for block.item1 and it's description:

    lov_pkg.clear_associations;
    lov_pkg.assign_return_item('block.item1', 1 );
    lov_pkg.assign_return_item('block.item1_desc', 2 );
    my_replacement_lov ( 'dummy_lov' );

ie.
package body lov_pkg is

    type associated_block_tabtype is table of varchar2(60)     index by binary_integer;

   associated_block_item associated_block_tabtype;     empty_block_tabtype associated_block_Tabtype;

  • might want to use this? max_assignable_return_items constant pls_integer := 3;

    procedure clear_associations is
    begin

         associated_block_item := empty_block_tabtype;     end;

    procedure assign_return_item ( item_name_in in varchar2, item_num_in in number ) is

      my_item item;
    begin

       my_item := find_item ( item_name_in );
       if not id_null ( my_item ) then
          associated_block_item( item_num_in ) := item_name_in;
          -- maybe store the id!
       end if;

    end assign_return_item;

    procedure my_replacement_lov( lov_name_in in varchar2 ) is       lov_id lov;
    begin

      lov := find_lov( lov_name_in );
      if not id_null( lov ) then
          results := show_lov(lov);
          if results then
               for i in 1..associated_items.count loop
                   copy( lov_pkg.associated_block_item(i), name_in(
'global.item' || i );
               end loop;
          end if;
     end if;

    end my_replacement_lov;
end lov_pkg;

"Ada" <ada106_at_yahoo.com> wrote in message news:6bd047ec.0204220201.42b6a03a_at_posting.google.com...
> Hi,
>
> I have a form with 3 items (e.g. id_01, id_02, id_03). They will
> invoke the same LOV. But the LOV Column Mapping can only map to one
> item (e.g. id_01) after selecting the value of the list. Now, can I
> dynamically map the column to different items with the same LOV? i.e
> When item 'id_01' invokes the LOV, then the result map to item id_01.
> When item id_02 invokes the LOV, then the result map to item 'id_02'.
>
> Or do you have any idea?
>
> Ada
>
Received on Sat Apr 27 2002 - 04:06:32 CEST

Original text of this message