Home » Developer & Programmer » Forms » how attach list item values based on another list item (forms6i)
how attach list item values based on another list item [message #307951] Thu, 20 March 2008 09:15 Go to next message
karunakar_adepu84
Messages: 43
Registered: January 2008
Member
Hi Friends,
I want to add list item values based on another list item.

which means
I have the country names in one list item
when I pressed one value in this list item, based on this
list item I want to generate the city names in another
list item.
please help me.
Re: how attach list item values based on another list item [message #308008 is a reply to message #307951] Thu, 20 March 2008 14:55 Go to previous messageGo to next message
solisdeveloper
Messages: 48
Registered: March 2008
Location: Mexico
Member
You could try this:

Create a procedure that receives the country-ID, and acording to it you populate the cities List-Item using the Add_List_Element Built-In, in this case using the data obtained from a query.

Then in the When-List-Change Trigger of the List Item containing all the countries, call that procedure sengind it the country-ID as parameter:

This is what your procedure could look like:
PR_populate_cities (p_country_id cities.country%TYPE) IS
  Cursor c_cities IS
  Select city_id, city_name
  From cities Where country = p_country_id;
Begin
  FOR c in c_cities LOOP
    Add_List_Element(:blk_block.it_cities, 1, c.city_name, c.city_id); 
  END LOOP;
END;


And this is what the code on your When-List-Change Trigger could look like:
pr_populate_cities (:blk_block.it_countries;);


Hope this helps
Regards!
Re: how attach list item values based on another list item [message #308200 is a reply to message #307951] Fri, 21 March 2008 23:39 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
If the values that will be going to display in the 2nd list item which is dependent on another list item from a database table then you have to see RECORD GROUP and POPULATE LIST. These are aviable in Forms help.

If you are going to assign these values on runtime then see:

01- Add_List_Element()
02- Delete_List_Element()
03- List_Element_Count()
04- Clear_List()

I m sure your will problem will be solved.

Regards,
Azam Khan
Re: how attach list item values based on another list item [message #308914 is a reply to message #307951] Tue, 25 March 2008 23:10 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use two items, each with an LOV, each using a record_group. Put the first item into the 'where' clause of the second record_group.

Its that simple.

David
Previous Topic: steps needed to download from unix to windows desktop
Next Topic: Very Urgent(Passing Parameters)
Goto Forum:
  


Current Time: Mon Feb 10 03:00:40 CST 2025