Can a spinner or Inputlist hold a hidden value?

Base

Member
Licensed User
Longtime User
Hi all,

Does anyone know if a spinner or an inputlist can hold a hidden value (primary key for example).

I want to ad a field on a form where the user can select a record from a database table and the store primary key from this record as a hidden value to a spinner or an inputlist. Like the listview can do.
When the records is saved the primary key is stored in the database and later, when the record is opened again, the spinner shows the selected (related) record.

Does anyone know if this is possible or if the is an other way to do this?

Thanks for any information.

Base
 

Base

Member
Licensed User
Longtime User
Hi Barx,

Thanks for the information.
I checked the code Erel supplied however that means that the visible textvalue in the spinner must be a unique value because by clicking on the spinner a search is started on the visible textvalue.

Regards,

Base
 
Upvote 0

Base

Member
Licensed User
Longtime User
Well, for instance if there are two persons which have the name John Doe.
I know what you mean but in that case the spinner has to show an extra fieldvalue which makes the spinner option unique:

"John Doe, Androidstreet 2, Amsterdam"
 
Upvote 0

Base

Member
Licensed User
Longtime User
Yes, i understand.
But why using a map?
When an unique string is presented in the spinner, the records can directly be found in the database by that string.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
There is always more than one way to skin a cat. Its just choosing the option that is right for you. The example doesn't require the use of a database. Which could be a plus for some.

Sent from my HTC Vision using Tapatalk
 
Upvote 0
Top