Home » Developer & Programmer » Forms » List item label of current selection (Forms 6i)  () 1 Vote
List item label of current selection [message #553891] Wed, 09 May 2012 02:20 Go to next message
praveenpraj
Messages: 19
Registered: October 2011
Location: India
Junior Member
How to get the label (not value) of current selection in a List Item.
Re: List item label of current selection [message #553899 is a reply to message #553891] Wed, 09 May 2012 02:59 Go to previous messageGo to next message
Littlefoot
Messages: 21265
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
GET_ITEM_PROPERTY is used to get different item properties. I wouldn't know how to get what you are looking for (i.e. didn't find any property that returns current selection's label).

What will you do with it, anyway? Aren't VALUES significant (instead of their labels)?
Re: List item label of current selection [message #553949 is a reply to message #553899] Wed, 09 May 2012 07:16 Go to previous messageGo to next message
praveenpraj
Messages: 19
Registered: October 2011
Location: India
Junior Member
I need to pass selected list item element's label to a report.
There is a function GET_LIST_ELEMENT_LABEL() to get the label of a particular index.
But no function to get the currently selected List_index.

[Updated on: Wed, 09 May 2012 07:21]

Report message to a moderator

Re: List item label of current selection [message #553950 is a reply to message #553949] Wed, 09 May 2012 07:18 Go to previous messageGo to next message
cookiemonster
Messages: 12957
Registered: September 2008
Location: Rainy Manchester
Senior Member
There's no way of getting it.
Have a table that stores all the possible values and corresponding labels.
Then pass the value and look up the label from the table in the report.
Re: List item label of current selection [message #553961 is a reply to message #553950] Wed, 09 May 2012 07:52 Go to previous messageGo to next message
praveenpraj
Messages: 19
Registered: October 2011
Location: India
Junior Member
Finally I made a common function for this.
I am going to use this in many forms.
So please let me know if it will cause any problem.
FUNCTION Get_list_label(p_listname IN VARCHAR2) 
RETURN VARCHAR2 
IS 
  v_count NUMBER; 
BEGIN 
    v_count := Get_list_element_count(P_LISTNAME); 

    FOR i IN 1..v_count LOOP 
        IF Get_list_element_value(p_listname, i) = Name_in(p_listname) THEN 
          RETURN Get_list_element_label(p_listname, i); 
        END IF; 
    END LOOP; 

    RETURN NULL; 
END; 
Re: List item label of current selection [message #553968 is a reply to message #553961] Wed, 09 May 2012 08:06 Go to previous messageGo to next message
cookiemonster
Messages: 12957
Registered: September 2008
Location: Rainy Manchester
Senior Member
Seems I was wrong, there is a way.
Can't see any obvious problem with the function.

However, what happens when you want a report that displays multiple rows, with multiple values for the list item column?
Are you going to pass all the labels as parameters?
I think you'd be better off doing what I suggested above.
Re: List item label of current selection [message #553971 is a reply to message #553968] Wed, 09 May 2012 08:15 Go to previous messageGo to next message
praveenpraj
Messages: 19
Registered: October 2011
Location: India
Junior Member
It is a Poplist. So multiple selection will not happen.
Thanks a lot for the support.
Re: List item label of current selection [message #553974 is a reply to message #553971] Wed, 09 May 2012 08:24 Go to previous messageGo to next message
cookiemonster
Messages: 12957
Registered: September 2008
Location: Rainy Manchester
Senior Member
I was talking about multiple records, each one having a different value, not one record having multiple values.
icon14.gif  Re: List item label of current selection [message #665822 is a reply to message #553961] Fri, 22 September 2017 12:24 Go to previous messageGo to next message
rchristianwc
Messages: 1
Registered: September 2017
Location: Costa Rica
Junior Member
(praveenpraj) Thanks for your help ... this is a very useful function
Re: List item label of current selection [message #665823 is a reply to message #665822] Fri, 22 September 2017 19:12 Go to previous message
BlackSwan
Messages: 25743
Registered: January 2009
Location: SoCal
Senior Member
This thread is only 5+ YEARS old
Previous Topic: change visual attribute for the current record
Next Topic: unable to launch form application online
Goto Forum:
  


Current Time: Tue Dec 12 10:53:35 CST 2017

Total time taken to generate the page: 0.01439 seconds