defalut item in spinner (dbutils)

gapi

Active Member
Licensed User
Longtime User
Hi, I've a spinner filled with DButils method, how can set a default item ?
tnx
 

mc73

Well-Known Member
Licensed User
Longtime User
I think you can use the selectedIndex property of your spinner in order to set a 'default' value.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Integer. The position of the item you want. If you want to search for default string, you can use the indexOf property in order to get the appropriate position.
 
Upvote 0

gapi

Active Member
Licensed User
Longtime User
Integer. The position of the item you want. If you want to search for default string, you can use the indexOf property in order to get the appropriate position.

..indexOf, small example ? I make (after dbutils for spinner) a query and with cursor I search default item for spinner.

thanks

p.s.
B4X:
merceDefault = DBUtils.ExecuteMap(Main.SQL1, queryMerce, Null)
log(merceDefault)  '<-- here it's ok return right value
spinDestMerci.Initialize("spinDestMerci")
DBUtils.ExecuteSpinner(Main.SQL1, queryAll, Null, 0, spinDestMerci)
spinDestMerci.selectedIndex = spinDestMerci.IndexOf(merceDefault)

not seem to work ....
 
Last edited:
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
I haven't worked with dbUtils, but from what I see, you're searching inside the spinner for a map? You should search with indexOf, using the get method of the map. At least so I think :)
 
Upvote 0
Top