T TERRIEN Member Licensed User Longtime User May 5, 2015 #1 Hi, I found nothing by searching so I decided to open my own thread about my prob. I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var. Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks
Hi, I found nothing by searching so I decided to open my own thread about my prob. I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var. Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks
DonManfred Expert Licensed User Longtime User May 5, 2015 #2 Look at the documentation https://www.b4x.com/android/help/views.html#spinner https://www.b4x.com/android/help/views.html#spinner_selecteditem Upvote 0
Look at the documentation https://www.b4x.com/android/help/views.html#spinner https://www.b4x.com/android/help/views.html#spinner_selecteditem
walterf25 Expert Licensed User Longtime User May 5, 2015 #4 TERRIEN said: Hi, I found nothing by searching so I decided to open my own thread about my prob. I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var. Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks Click to expand... You need to do : B4X: Spinner.GetItem(x) X = whatever index you need to get Walter Upvote 0
TERRIEN said: Hi, I found nothing by searching so I decided to open my own thread about my prob. I just wanna know how can I do to get the spinner1 actual text (E or I) and add it to my var. Found nothing about get the text of an spinner except SpinnerMap but this isn't working, and there is no spinner1.text so, thanks Click to expand... You need to do : B4X: Spinner.GetItem(x) X = whatever index you need to get Walter
T TERRIEN Member Licensed User Longtime User May 5, 2015 #5 Oh it returns the value as a text ! Sorry for this stupid thread, but thanks for your help ! Upvote 0
T TERRIEN Member Licensed User Longtime User May 5, 2015 #6 And by the way, for the people who hasn't understand what has been said, here is the code : B4X: VARIABLE = Spinner1.SelectedItem And for exemple VARIABLE will return, as string the text that is selected in the spinner, for my exemple 'E'. In my exemple : B4X: pers = Spinner1.SelectedItem pers = pers & Spinner2.SelectedItem pers = pers & Spinner3.SelectedItem pers = pers & Spinner4.SelectedItem It return a 4 chars letters used to redirect the user to this page or this other one.. Hope I was enough understandable for you, according on the fact I have a pretty bad english. Upvote 0
And by the way, for the people who hasn't understand what has been said, here is the code : B4X: VARIABLE = Spinner1.SelectedItem And for exemple VARIABLE will return, as string the text that is selected in the spinner, for my exemple 'E'. In my exemple : B4X: pers = Spinner1.SelectedItem pers = pers & Spinner2.SelectedItem pers = pers & Spinner3.SelectedItem pers = pers & Spinner4.SelectedItem It return a 4 chars letters used to redirect the user to this page or this other one.. Hope I was enough understandable for you, according on the fact I have a pretty bad english.
Beja Expert Licensed User Longtime User May 5, 2015 #7 pers = Spinner1.SelectedItem pers = pers & Spinner2.SelectedItem pers = pers & Spinner3.SelectedItem pers = pers & Spinner4.SelectedItem Click to expand... I think you didn't test the above code.. If I correctly understood what you wanted, then the code should be: pers = Spinner(1).SelectedItem pers = pers & Spinner(2).SelectedItem pers = pers & Spinner(3).SelectedItem pers = pers & Spinner(4).SelectedItem (in you don't want to include spinner(0). Upvote 0
pers = Spinner1.SelectedItem pers = pers & Spinner2.SelectedItem pers = pers & Spinner3.SelectedItem pers = pers & Spinner4.SelectedItem Click to expand... I think you didn't test the above code.. If I correctly understood what you wanted, then the code should be: pers = Spinner(1).SelectedItem pers = pers & Spinner(2).SelectedItem pers = pers & Spinner(3).SelectedItem pers = pers & Spinner(4).SelectedItem (in you don't want to include spinner(0).
klaus Expert Licensed User Longtime User May 6, 2015 #8 @Beja Don't confuse 4 individual Spinners called Spinner1, Spinner2, Spinner3, Spinner4. With an Array of 4 Spinners Spinner(0), Spinner(1), Spinner(2), Spinner(3). Upvote 0
@Beja Don't confuse 4 individual Spinners called Spinner1, Spinner2, Spinner3, Spinner4. With an Array of 4 Spinners Spinner(0), Spinner(1), Spinner(2), Spinner(3).