Sie sind auf Seite 1von 3

2/4/13

Dev talks blog: Quick tip 3: How to get List index in oracle forms builder

Friday, 25 July 2008

Quick tip 3: How to get List index in oracle forms builder


As i can see, many people have this problem. They have a hard time to get index of an item selected in some list. As I can tell, there isnt a function like GET_LIST_INDEX() or something like that. I had this problem myself few times before, and then I wrote this PL/SQL function:

About Me

D A R K O K A LI NI C P O D GO R I CA , MO NTE NE GR O

Software developer at CKB My CV View my complete profile

FUNCTION getListIndex (LIST IN VARCHAR2, VAL IN VARCHAR2) RETURN INTEGER IS BEGIN IF To_Number(Get_List_Element_Count(LIST))>0 THEN FOR i IN 1..To_Number(Get_List_Element_Count(LIST)) LOOP IF Get_List_Element_Value(LIST,i) = VAL THEN Return i; END IF; END LOOP; ELSE RETURN -1; END IF; END;

And to find out which index you selected by clicking on the list, call getListIndex(blockX.listX , :blockX.listX); This will return selected index, and -1 if the list is empty For example, to delete something from some list you just cdouble-clicked, call: -- on WHEN-MOUSE-DOUBLECLICK trigger:
devtalks.blogspot.com/2008/07/quick-tip-3-how-to-get-list-index-in.html

Blog Archive 2010 (4) 2009 (17) 2008 (21) December (1) November (4)
1/3

2/4/13

Dev talks blog: Quick tip 3: How to get List index in oracle forms builder

... DELETE_LIST_ELEMENT('block3.list4',getListIndex('block3 .list4',:block3.list4)); ...


Posted by Darko Kalinic at 03:02 Labels: Oracle, PL/SQL

October (2) September (3) August (3) July (8) working with finances in java Quick tip 3: How to get List index in oracle forms... Some of the SAX Parser issues I came up to... Izaao je Eclipse 3.4 Ganymede Quick tip 2: Enable TDBGrid to show all columns wi... Quick tip 1: Session save path Unwriteable (tested... How to bring back old component palette look to BD... Creating and using Java beans in Oracle Forms buil...

2 comments: Anonymous said... MUCHAS GRACIAS POR EL APORTE ME HA AYUDADO MUCHO :-), DE VERDAD MUCHAS GRACIAS
12 March 2011 17:49

Anonymous said... Nice function, I have used it. Thank you.


21 Se pte m be r 2012 05:51

Post a Comment

Labels Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Java (9) Oracle (9) NetBeans (7) Struts2 (7) Events

(6) PL/SQL (5) Borland C++ Builder (4) Eclipse (4) Books
(2) My applications (2) PHP SAX Parser (2) (2) Subversion (2) Tomcat (2) Web services (2) Glassfish (1)
JavaScript (1)
devtalks.blogspot.com/2008/07/quick-tip-3-how-to-get-list-index-in.html 2/3

2/4/13

Dev talks blog: Quick tip 3: How to get List index in oracle forms builder

Visit related blogs Baze podataka MySQL, Oracle, PostgreSQL, MS SQL Server, Access, modelovanje podataka ... Andreas Weiden About Oracle Francois Degrelle's blog Inside dev

Subscribe To Posts Comments

devtalks.blogspot.com/2008/07/quick-tip-3-how-to-get-list-index-in.html

3/3

Das könnte Ihnen auch gefallen