Home » Developer & Programmer » Forms » Elements in Lists
Elements in Lists [message #148697] Sat, 26 November 2005 09:30 Go to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Hi,
Guys i am confused regarding to List item.

Can anyone clear my doubt that why we use RECORD group for List Item.
List shows and take the values which are written in its "Elements in List" property then what is the use of record group.
Record group is work in LOV's but why we use it in List item.

Please clear my doubt.
Waiting for yours worth reply and thanks in advance.

Shaila this side.
Re: Elements in Lists [message #148727 is a reply to message #148697] Sun, 27 November 2005 03:52 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Hi Shaila,
If you want populate list item with a query, you can do it using record groups.

http://www.orafaq.com/forum/t/54531/0/
I think you asked something in the above topic also.

At design time you can not create a empty list item.
So you need to create some dummy values.
If you want to populate the list item with the manager names in employee table, first of all you need to clear the list item.
Then you need to create record group and populate list.

You can refer the above link for the functions you need to use.

By
Vamsi.
Re: Elements in Lists [message #149157 is a reply to message #148727] Wed, 30 November 2005 06:48 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Thanks kasina. I got what i really want.

Shaila.
Re: Elements in Lists [message #149185 is a reply to message #148727] Wed, 30 November 2005 08:28 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Hi kasina, i went through the link and there i saw the coding like this--

DECLARE
group_name varchar2(40) :='LIST26';
group_id RecordGroup;
list_id Item := Find_Item('ARTICLE.LIST26');
status NUMBER;

BEGIN

IF Id_null(group_id) THEN
group_id := Create_Group_From_Query('LIST26','select topic_ID,topic_ID from topic');
END IF;

Clear_List(list_id);
status := Populate_Group('LIST26');
Populate_List(list_id,group_id);

END;

Now my question is why we use 'LIST26'.
And what is 'List_id' item.
Can you explain how we declare this item.

Thanks in advance.
Shaila

Re: Elements in Lists [message #149188 is a reply to message #148697] Wed, 30 November 2005 08:33 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
Quote:

Now my question is why we use 'LIST26'.
And what is 'List_id' item.
Can you explain how we declare this item.


LIST26 is the list item name in the block "ARTICLE".

List_Id is just a object which of type "ITEM" , you could store Item_id in this using "Find_Item" built-in.

Declaration is there in the code itself.It is just declaring like a normal variable , eg: list_id item;

--Kiran.
Re: Elements in Lists [message #150141 is a reply to message #149188] Tue, 06 December 2005 08:51 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member


This is the form LISTss.fmb (scott/tiger) where i want to create list on empno. But i am failed to populate it.
Please tell me where i am doing mistake.

Waiting for your worth reply.
Shaila.
  • Attachment: LISTss.fmb
    (Size: 48.00KB, Downloaded 1071 times)
Re: Elements in Lists [message #150270 is a reply to message #150141] Tue, 06 December 2005 23:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay the only trigger I found was:
WHEN-NEW-FORM-INSTANCE (Form)
DECLARE
   group_name  VARCHAR2(40) := 'empno';
   group_id    recordgroup;
   list_id     item := Find_item('emp.empno');
   status      NUMBER;
BEGIN
  IF Id_null(group_id) THEN
    group_id := Create_group_from_query('empno',
                                        'select empno,empno from emp');
  END IF;
  
  Clear_list(list_id);
  
  status := Populate_group('empno');
  
  Populate_list(list_id,
                group_id);
END;

Please go back to the reference manual and make sure that you have ALL the bits and pieces from the sample code in your work.

You are MISSING the Find_Group statement which should be before the IF Id_Null statement.

David

Re: Elements in Lists [message #150355 is a reply to message #150270] Wed, 07 December 2005 08:56 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

Same problem again. I am unable to populate the list.
I am again attaching the .fmb file.
Actually i am not getting the concept of creating and populating Lists clearly.
Please clarify my doubts.

Shaila.
  • Attachment: Error.fmb
    (Size: 48.00KB, Downloaded 1034 times)
Re: Elements in Lists [message #150434 is a reply to message #150355] Wed, 07 December 2005 19:20 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please just post the code. IT IS A PAIN to have to extract the code from the FMB everytime.

Have you downloaded and read the reference manual??

David
Re: Elements in Lists [message #150452 is a reply to message #150355] Wed, 07 December 2005 23:56 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
At last I got the solution though it kills lot of time.

1) You have given an initial value for the list item, which is not in the database i.e., 10. Remove the initial value.

2) Please remember that if you are using populate_list to populate a list item and creating record group using create_group_from_query, then two varchar2 columns should be selected from the query.

So you need to change the form as the following
1)No initial value or initial value should be anyone of the values from the query
2) The query should be 'select to_char(empno), to_char(empno) from emp'

By
Vamsi.
Re: Elements in Lists [message #150579 is a reply to message #150434] Thu, 08 December 2005 09:09 Go to previous messageGo to next message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

From where i download manuals.

shaila.
Re: Elements in Lists [message #150580 is a reply to message #150452] Thu, 08 December 2005 09:18 Go to previous message
Shaila.Mehra
Messages: 88
Registered: July 2005
Location: mumbai
Member

My problem has solved. Thanks to all of you.

And thank you very much Kasina for your great help.

Shaila.
Previous Topic: How to get 4th highest salary
Next Topic: Generating unique numbers
Goto Forum:
  


Current Time: Fri Sep 20 04:51:11 CDT 2024