How To Store One Column Item From a Spinner Displaying Two Columns

Mahares

Expert
Licensed User
Longtime User
I Have an SQLite table that is dispalyed via a spinner. It has two columns: CODE and DESCRIPTION. I can display both columns in the spinner, but when I select an item from the spinner I would like to only store the CODE in the table. I have done it using a crude way by separating the 2 columns with an semi-colon and parsing the string with Substring2, but I think there is a better way. I saw that 'ExecuteSpinner' might do that , but I diod not find any examples. Does anyone have a better solution?
Thank you
 

gapi

Active Member
Licensed User
Longtime User
Spinner cannot hold extra information (unlike ListView).
A possible solution is to use a Map with the spinner values as the keys and the extra information as the map values.

small sample, thanks erel :sign0188:
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Usually I initialize a list containing the 'code' based on the index of the spinner. When the spinner_itemClick is raised, I get the correct code from the list.
 
Upvote 0

gapi

Active Member
Licensed User
Longtime User
what scope for this list ?

In -> Process_Globals or in Globals ?

tnx
 
Last edited:
Upvote 0
Top