Re: List item

From: Matthew D. Bennett <mbennett_at_utah-inter.net>
Date: Mon, 05 Nov 2001 09:07:45 -0700
Message-ID: <3BE6B94A.85DB87CB_at_utah-inter.net>


Stjepan,

This is a good question. You will need to create a PRE-FORM trigger with the following PL/SQL code:

DECLARE
  rg_name VARCHAR2(40) := 'Some_description';   rg_id RecordGroup;
  errcode NUMBER;
BEGIN
  rg_id := CREATE_GROUP_FROM_QUERY(rg_name,

             'SELECT B2, to_char(B1) FROM B');   errcode := POPULATE_GROUP(rg_id);
  POPULATE_LIST('BLOCK.LISTBOX', rg_id); END; I couldn't find an example in the Oracle documentation so I made sure to include it in my latest book "Programming with Oracle Developer." You may want to order yourself a copy from Amazon.com.

Let me know if you need more information.

Matt.

Stjepan Brbot wrote:
>
> I have two tables: tableA has columns A1,A2; tableB has columns B1,B2.
> Among tableA and tableB there is relationship - A2 is FK, B1 is PK.
>
> +-----------------+ +-----------------+---+
> |A1 | |B2 + v +
> +-----------------+ +-----------------+---+
>
> On Oracle form (I use Oracle Developer 6i) I'd like to have listbox
> (list item) containing all values from B2. After I select an B2 item
> from listbox, the corresponding B1 value (for this B2 value from tableB)
> should be inserted into A2.
>
> Also vice versa, when the form is loaded (initiated) - listbox should
> show corresponding initial value B2 of existing value for A2
>
> I know how to create text item containging list of values (LOV) but do
> not konow how to create listbox with dynamic LOV? I know how to create
> listbox with static values but how to create listbox containing all
> values from an column? Do anybody have a sample code for list
> item population and selecting values?
>
> --
>
> Stjepan Brbot [Stjepan.Brbot_at_ZG.HiNet.HR]
  Received on Mon Nov 05 2001 - 17:07:45 CET

Original text of this message