Pop list index retrieval [message #111063] |
Sun, 13 March 2005 01:46 |
mathan
Messages: 24 Registered: March 2005
|
Junior Member |
|
|
Hi,
I have the following problem with a poplist.
a. Retrieve all the values and the list index(eg: 1,2,3) from the list item and store them in a pl/sql table.
b. When a value is chosen from the list,I need to get the list index from the list for that chosen value, and use that to retrieve the value from pl/sql table.
I am using retrieve_list to store the values and even the list index using a counter. But I am unable to figure out how to get the appropriate list index for the chosen list value.
Note - The label and value are same. Hence I cant use label as a list index.
Eg - for list item values 'a1','b1','b2','c3' , I want to store them in table as (1,'a1'),(2,'b1'),(3,'b2'),(4,'c3). And when 'b2' is chosen , I want to get 3 from the list, and use that to retrieve the stored value in the table.
I dont mind any other solution too where I can use numbers to store and retrieve values.
PLEASE HELP ASAP!!!
Thanks in advance
Madan
|
|
|
|
|
|
Re: Pop list index retrieval [message #111117 is a reply to message #111063] |
Mon, 14 March 2005 00:46 |
mathan
Messages: 24 Registered: March 2005
|
Junior Member |
|
|
Okay I get it. But I have another problem. I cannot touch the query which creates the poplist as this query comes from another application.And I need to only use numbers for comparison.
|
|
|
Re: Pop list index retrieval [message #111118 is a reply to message #111063] |
Mon, 14 March 2005 01:00 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Sorry ... I don't write my code this way, I have more control over my inputs.
I can't test the following ideas but try them. Create a package. In the 'spec', define a 2 column array, in the When_New_Form_Instance trigger loop through the values using a counter of i:=i+1 (starting from zero before the loop), load the two values in the array. Then in the When_Validate_Item on the Pop-List field, do another loop looking for the 'package.array(data)' then when you have found it, you have the element number. You could probably do it with a single column array and count the line number on retrieval.
Some-one else may have code that does this but I don't. Sorry.
[Updated on: Mon, 14 March 2005 01:00] Report message to a moderator
|
|
|