list item populate with a query but cannot select the values [message #145473] |
Thu, 03 November 2005 06:42 |
itfreak
Messages: 7 Registered: November 2005
|
Junior Member |
|
|
hi,
i am using Forms [32 Bit] Version 9.0.2.9.0 (Production)
Personal Oracle9i Release 9.2.0.1.0 - Production.
i have searched a lot for a solution for this problem and am posting my topic after a lot of failures.there are similar problems discussed in other topics but none is of any use.
i have 2 tables TOPIC,ARTICLE
TOPIC fields
TOPIC_ID NOT NULL VARCHAR2(15)
TOPIC_NAME NOT NULL VARCHAR2(100)
SUBJECT_CODE NOT NULL VARCHAR2(15)
Article Fields
ARTICLE_ID NOT NULL NUMBER
ARTICLE_DESC NOT NULL VARCHAR2(500)
CONTENT NOT NULL LONG
AUTHOR NOT NULL VARCHAR2(100)
ARTICLE_DATE NOT NULL DATE
TOPIC_ID NOT NULL VARCHAR2(15)
i am creating a form on the ARTICLE table with a poplist on the topic_id field.i want to populate the topic_id field in the form with the values in the topic_id fiels in the TOPIC table.i am doing this cause the topic_id field is compulsory in the form.
i created a trigger WHEN-NEW-ITEM-INSTANCE with the following code
DECLARE
group_name varchar2(40) :='LIST26';
group_id RecordGroup;
list_id Item := Find_Item('ARTICLE.LIST26');
status NUMBER;
BEGIN
group_id := Create_Group_From_Query('LIST26','select topic_ID,topic_ID from topic');
Clear_List(list_id);
status := Populate_Group('LIST26');
Populate_List(list_id,group_id);
END;
-----NOTE list26 is the name of the list in the form---
when i run the form the poplist is displayed with no values when i click the down arrow in the poplist i can see the values from the topic_id field in the TOPIC table but when i select a value i get an error
FRM-40202: Field must be entered.
and the value is not selected.
can anyone give me a solution.
on some research i think the problem is with the Mapping other values in the property pallette of the list item.but i could not figure out what value to specify there.
the help section says this
Leave this property blank to indicate that other values are not allowed for this item or radio group. Any queried record that contains a value other than the user-defined element value is silently rejected. Any attempt to assign an other value is disallowed.
Any value you specify must evaluate to one of the following references: the value associated with one of the list elements or radio groups the name (not the label) of one of the list elements
dont really know whether this is the problem or something else.
pls give me a solution
|
|
|
|
|
Re: list item populate with a query but cannot select the values [message #145612 is a reply to message #145588] |
Fri, 04 November 2005 03:26 |
itfreak
Messages: 7 Registered: November 2005
|
Junior Member |
|
|
could you explain how i can use it in my example.
i have not understood this line of code
rg_id := Create_group_from_query(rg_name,
'SELECT SAL-MOD(SAL,1000) BASE_SAL_RANGE,' || 'COUNT(EMPNO) EMPS_IN_RANGE ' || 'FROM EMP ' || 'GROUP BY SAL-MOD(SAL,1000) ' || 'ORDER BY 1');
what r the fields and how can i apply this to my example?
|
|
|
Re: list item populate with a query but cannot select the values [message #145726 is a reply to message #145612] |
Sat, 05 November 2005 06:53 |
Shaila.Mehra
Messages: 88 Registered: July 2005 Location: mumbai
|
Member |
|
|
Hi,
Itfreak, could you tell me why you used "Clear_List(list_id)"
functions here.
well try this coding.....DECLARE
group_name VARCHAR2(40) := 'LIST26';
group_id recordgroup;
status NUMBER;
BEGIN
group_id := Find_item(group_name);
IF Id_null(group_id) THEN
group_id := Create_group_from_query(group_name,
'select topic_ID,topic_ID from topic');
END IF;
status := Populate_group(group_id);
Populate_list('group_name',
group_id);
END; Shaila Mehra.
Upd-mod: Add code tabs
[Updated on: Sun, 06 November 2005 19:37] by Moderator Report message to a moderator
|
|
|
|
|
|
|
Re: list item populate with a query but cannot select the values [message #145886 is a reply to message #145473] |
Mon, 07 November 2005 08:16 |
itfreak
Messages: 7 Registered: November 2005
|
Junior Member |
|
|
i am able to populate the list with the following code
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;
the list is displayed in the form
but i cannot select any value from this list
what do you think is the problem?
|
|
|
|
|
|
|