• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 212
  • Last Modified:

why clear_list not clear the list in oracle form

here is my sample code.....please check what is wrong in this code why clear_list not clear the list before updating the list for second selection from drop-down....

DECLARE

   CURSOR CUR_FURNACE_CAT_TYPE(F_TYPE IN CHAR) IS
   
   SELECT FURNACE_TYPE,CAT_TYPE_DESC,CAT_TYPE_ID
   from PRC_FURNACE_CAT_TYPE
   WHERE FURNACE_TYPE=F_TYPE
   order by  CAT_TYPE_ID;
   
   V_CNT NUMBER := 1;

BEGIN
    CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');

       IF :PRC_HT_FURNACE.FURNACE_TYPE='04' THEN  
     
              FOR LP IN CUR_FURNACE_CAT_TYPE('04') LOOP    
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                 
              END LOOP;
     
       ELSIF :PRC_HT_FURNACE.FURNACE_TYPE='05'  THEN  
                                               
              FOR LP IN CUR_FURNACE_CAT_TYPE('05') LOOP          
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                  
              END LOOP;
           
        ELSIF :PRC_HT_FURNACE.FURNACE_TYPE='06'  THEN  
                                               
              FOR LP IN CUR_FURNACE_CAT_TYPE('06') LOOP
                    
                                  ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                  V_CNT := V_CNT + 1;
                                  
          END LOOP;                                    
        END IF;

 END;
0
ash s
Asked:
ash s
  • 12
  • 8
2 Solutions
 
Helena Markováprogrammer-analystCommented:
Where (in what trigger) is the provided code used ?  Also you have to read Clear_list built-in in the Forms on-line help for usage notes and restriction.
0
 
ash sAuthor Commented:
in when_list_changed trigger i used that code....
0
 
ash sAuthor Commented:
that is Drop down list 2 which depends on the value that it is selected in Drop down list 1

somehow on list changed of Drop down list 1 i want the Drop down list 2 to be filtered.

i write drop down list 1 code in when new form instance......and drop down list 2 code in when_list_changed trigger.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
ash sAuthor Commented:
supposed i have 1st list the
A
B
C

if i select 'A'

then Second list show
 1
2
3
and if i select B in 1 drop-down list
then 2nd list show
3
4
5
0
 
ash sAuthor Commented:
but in my code problem is that when i select A then it show result
1
2
 3
and when i select B then it show
3
4
5
1
2
3
clear_list not clear the list.
0
 
Helena Markováprogrammer-analystCommented:
If I understand it correctly there is 1st list - PRC_HT_FURNACE.FURNACE_TYPE and second PRC_HT_FURNACE.CATEGORY. Is there any error ?
Have you try only this code ?

 BEGIN
     CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');
END;
0
 
ash sAuthor Commented:
yp, u understand correctly.............problem is that clear list not clear the 2 list before updating the 2 list depend on list 1.............
0
 
ash sAuthor Commented:
i write whole above code(2nd drop down list code) in when_list_changed trigger and 1st drop down list code in when-new-form-instance......
0
 
Helena Markováprogrammer-analystCommented:
I am lost:
1st list - PRC_HT_FURNACE.FURNACE_TYPE - here is When-List-Changed trigger ?
2nd list - PRC_HT_FURNACE.CATEGORY
0
 
ash sAuthor Commented:
no............
1st list - PRC_HT_FURNACE.FURNACE_TYPE -------------------code in when_new_form_instance
2nd list - PRC_HT_FURNACE.CATEGORY--------code in When-List-Changed trigger
0
 
Helena Markováprogrammer-analystCommented:
But When-list-changed trigger is on what item- PRC_HT_FURNACE.FURNACE_TYPE or PRC_HT_FURNACE.CATEGORY ?
0
 
ash sAuthor Commented:
When-list-changed trigger is on PRC_HT_FURNACE.CATEGORY
0
 
ash sAuthor Commented:
sorry When-list-changed trigger is on item- PRC_HT_FURNACE.FURNACE_TYPE
0
 
Helena Markováprogrammer-analystCommented:
So it is the problem, because you cannot clear list item in its when-list-changed trigger.  You can use your code e.g. in When-New-Record-Instance trigger of block PRC_HT_FURNACE and also in When-list-changed trigger on PRC_HT_FURNACE.FURNACE_TYPE.

According to your last post it ought to work. Have you try only clear_list and see what will happen ?
0
 
ash sAuthor Commented:
i used When-list-changed trigger on PRC_HT_FURNACE.FURNACE_TYPE but it still not clear the list
0
 
Helena Markováprogrammer-analystCommented:
OK, try only this code

BEGIN
    CLEAR_LIST('PRC_HT_FURNACE.CATEGORY');
END;
0
 
ash sAuthor Commented:
in which item trigger i used this code?
0
 
Helena Markováprogrammer-analystCommented:
Please try it on When-List-Changed trigger on item PRC_HT_FURNACE.FURNACE_TYPE.
0
 
ash sAuthor Commented:
if i only use this code then how i populate the list PRC_HT_FURNACE.CATEGORY....................
0
 
Helena Markováprogrammer-analystCommented:
For this test you can use this part of your code in the When-New-Form-Instance trigger:
 FOR LP IN CUR_FURNACE_CAT_TYPE('04') LOOP    
                     
                                   ADD_LIST_ELEMENT('PRC_HT_FURNACE.CATEGORY', V_CNT, LP.CAT_TYPE_DESC,LP.CAT_TYPE_ID);
                                   V_CNT := V_CNT + 1;
                                   
               END LOOP;
0
 
Mark GeerlingsDatabase AdministratorCommented:
Have you considered using plain text items with LOVs instead of "list" items in Oracle Forms.  I find these easier to work with as a developer than list items, and more flexible for users (especially for querying).  But maybe you consider this combination to be "old fashioned" and "list items" to be more up-to-date or "user-friendly".  It is true that plain text items and LOVs have been supported in Oracle Forms for at least 30 years, and "list" items have only been supported for about 25 years.
 items
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 12
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now