dynamically populating a list item [message #696] |
Wed, 27 February 2002 04:52 |
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 #707 is a reply to message #696] |
Wed, 27 February 2002 10:12 |
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 |
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 |
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 |
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
|
|
|
|