Home » Developer & Programmer » Forms » Pop list index retrieval
icon5.gif  Pop list index retrieval [message #111063] Sun, 13 March 2005 01:46 Go to next message
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 #111100 is a reply to message #111063] Sun, 13 March 2005 18:49 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Can't you use a 'zero width' column containing the numbers '1' through 'n' which, when the 'b2' value is selected and returned to the displayed field, is returned to a non-displayed field which is then used to drive the rest of your logic?

David
Re: Pop list index retrieval [message #111108 is a reply to message #111063] Sun, 13 March 2005 23:47 Go to previous messageGo to next message
mathan
Messages: 24
Registered: March 2005
Junior Member
Hi,
Sorry I am not sure I understand what you mean. Can you please eloborate?
Thanks
Re: Pop list index retrieval [message #111110 is a reply to message #111063] Mon, 14 March 2005 00:05 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
In your record group produce two columns, one column is the data that you wnat to display, and the second column is the numbers '1' through 'n' (you can use ROWNUM to populate this second column in the SELECT statement you use to populate the record group). This second column has a display width of zero, and on retrieval is assigned to either a field in a 'control' block or a dummy field on the current block.
Re: Pop list index retrieval [message #111117 is a reply to message #111063] Mon, 14 March 2005 00:46 Go to previous messageGo to next message
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 Go to previous message
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

Previous Topic: couldnt connect forms with oracle
Next Topic: FRM-40735
Goto Forum:
  


Current Time: Thu Sep 19 18:06:27 CDT 2024