C cwt Active Member Licensed User Longtime User Sep 7, 2019 #1 I have created a ScrollView that has several Spinner views on it. The spinners work fine with being populated and show the selection made but the Spinner_ItemClick event never fires. The Spinners I have added directly to layouts work fine - ItemClick event fires when item clicked on spinner list but this does not work when the spinner is added via a scrollview. for testing, the code below is my event capture for the spinner clicked event: Code: Copy Sub MySpinner_ItemClick(Position As Int, Value As Object) Msgbox2("MySpinner_ItemClick event fired","","OK","","",Null) Dim ID As String ID = Value MyVariable.Text = MySpinnerMap.Get(ID) End Sub What am I missing here? Last edited: Sep 8, 2019
I have created a ScrollView that has several Spinner views on it. The spinners work fine with being populated and show the selection made but the Spinner_ItemClick event never fires. The Spinners I have added directly to layouts work fine - ItemClick event fires when item clicked on spinner list but this does not work when the spinner is added via a scrollview. for testing, the code below is my event capture for the spinner clicked event: Code: Copy Sub MySpinner_ItemClick(Position As Int, Value As Object) Msgbox2("MySpinner_ItemClick event fired","","OK","","",Null) Dim ID As String ID = Value MyVariable.Text = MySpinnerMap.Get(ID) End Sub What am I missing here?
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2019 #2 1. Please use [code]code here...[/code] tags when posting code. 2. Don't use Msgbox for debugging. Use Log instead. 3. Use xCLV instead of ScrollView. Upvote 0
1. Please use [code]code here...[/code] tags when posting code. 2. Don't use Msgbox for debugging. Use Log instead. 3. Use xCLV instead of ScrollView.
C cwt Active Member Licensed User Longtime User Sep 8, 2019 #3 Thanks Erel, My problem was caused because I did not initialize the Spinner with an event: I changed MySpinner.Initialize("") To this: MySpinner.Initialize("spinner") and added a tag to the spinner: MySpinner.Tag = "spinner_1" Then I was able to trap the event for each individual spinner on the ScrollView. Upvote 0
Thanks Erel, My problem was caused because I did not initialize the Spinner with an event: I changed MySpinner.Initialize("") To this: MySpinner.Initialize("spinner") and added a tag to the spinner: MySpinner.Tag = "spinner_1" Then I was able to trap the event for each individual spinner on the ScrollView.