Home » SQL & PL/SQL » SQL & PL/SQL » dynamically populating a list item
dynamically populating a list item [message #696] Wed, 27 February 2002 04:52 Go to next message
Julie
Messages: 98
Registered: February 2002
Member
I have 2 list items on my canvas. I want the first List Item to dynamically contain a list of values from a column in one of my tables. The contents of the second List Item is dependant on the users selection from the first list item and is values from another column.

I have tried attaching the following code to a WHEN-NEW-FORM-INSTANCE trigger to populate the first list item:

DECLARE
group_id RecordGroup;
list_id Item := Find_Item('list_item1');
status NUMBER;
BEGIN

group_id := Create_Group_From_Query (model_names','SELECT
model.model_id, model.model_id FROM model');
status := Populate_Group('model_names');
Populate_List(list_id,group_id);
END;

The code compiles successfully but when i run the form the list item is empty.

Please could somebody help.

Thanks,

Julie
Re: dynamically populating a list item [message #699 is a reply to message #696] Wed, 27 February 2002 06:22 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
which list item is empty..first/second.

if it first then check your query in sql*plus and make sure it contains data.

your code is fine.
Re: dynamically populating a list item [message #707 is a reply to message #696] Wed, 27 February 2002 10:12 Go to previous messageGo to next message
Julie
Messages: 98
Registered: February 2002
Member
Pratap,

Thanks for reply. It is the 1st List Item that is empty as I am only trying to populate that one first. Have run the query in sql*plus and there is data in the table. But still i cant get the list item populated.

Thanks, Nice Try.
Re: dynamically populating a list item [message #710 is a reply to message #696] Wed, 27 February 2002 23:40 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
i think model_id is of type number.so try this

DECLARE
group_id RecordGroup;
list_id Item := Find_Item('list_item1');
status NUMBER;
BEGIN

group_id := Create_Group_From_Query ('model_names','SELECT
to_char(model.model_id), to_char(model.model_id) FROM model');
status := Populate_Group('model_names');
Populate_List(list_id,group_id);
END;
Re: dynamically populating a list item [message #714 is a reply to message #696] Thu, 28 February 2002 00:40 Go to previous messageGo to next message
Julie
Messages: 98
Registered: February 2002
Member
Sorry Pratap,

Didn't work. Model_id is a char. Am sending you my test form and table stuff. If its not too much trouble, I would be eternally gratefull if you could have a quick look. You will probably then have a better idea of what i'm doing wrong.

Thanks very much for the help.

Julie
Re: dynamically populating a list item [message #716 is a reply to message #696] Thu, 28 February 2002 01:03 Go to previous messageGo to next message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
hi,

i got ur form and where is your list_item1, by the way there is no list item in the form.

create list item called list_item and then try.

now u r trying to populate a text item, perhaps u have misunderstood the concept

cheers
pratap
Re: dynamically populating a list item [message #719 is a reply to message #716] Thu, 28 February 2002 01:25 Go to previous message
Julie
Messages: 98
Registered: February 2002
Member
Sorry,
sent you an old copy of form with text item, instead of the one with the list item on. Model_id should be a list item.
Thanks.
Previous Topic: System table containing package information
Next Topic: manual configuration of oracle jvm
Goto Forum:
  


Current Time: Thu Mar 28 05:46:30 CDT 2024