Android Question AS_TextField Doubt?

RishiKumar2210

Active Member
Is there any way to use this as_advancedtextfield as spinner or combo box? I want it exactly like the Combo box when a user opens the Combo box menu, then I want to indicate the user by changing the focus title text color.
 

mcqueccu

Well-Known Member
Licensed User
Longtime User
Hello, can you please be specific and ask a direct question, make the Titles as descriptive as possible? I have been seeing your DOUBT question and its increasing.


Check How to ask question guide and forum etiquette


 
Upvote 0

RishiKumar2210

Active Member
sure Mr @mcqueccu
 
Upvote 0

RishiKumar2210

Active Member
Hey @Alexander Stolte. I have written something like this. When the user clicks the trailing icon, it opens the spinner and the title text color has been changed(refer to image 1), and when the user selects an item, again title text color returns to its original color(refer to image 2). But I have another problem, when the user clicks anywhere other than the spinner when the spinner dropdown opens, then the dropdown closes and I need to set the title text color to black(refer to image 2). Is there any other way to overcome this?

This is My Code.

B4X:
Private Sub AS_TextFieldAdvanced2_TrailingIconClick

    

    AS_TextFieldAdvanced2.Title.NonFocusedTextColor = Colors.Blue

    AS_TextFieldAdvanced2.Refresh

    

    Spinner1.As(JavaObject).RunMethod("performClick", Null)

    

End Sub


Private Sub Spinner1_ItemClick (Position As Int, Value As Object)

    AS_TextFieldAdvanced2.Text = Spinner1.SelectedItem

    

    AS_TextFieldAdvanced2.Title.NonFocusedTextColor = Colors.Black

    AS_TextFieldAdvanced2.Refresh

End Sub
 

Attachments

  • Screenshot_20240220-174127.png
    49.2 KB · Views: 52
  • Screenshot_20240220-174140.png
    36.8 KB · Views: 50
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
then the dropdown closes and I need to set the title text color to black(refer to image 2). Is there any other way to overcome this?
I really don't know what you want to achieve. If you have selected an item from the spinner, then the focus is no longer on this text field. Unlike the text based text field where the cursor makes the focus, as soon as you press enter, the focus is lost. With a combobox or button you have no focus point, unless you open the spinner and select an item, then the interaction is over. If you always want to change the title text color then I already showed you the way last week.
 
Upvote 0

RishiKumar2210

Active Member
Thank You For Your Help, @Alexander Stolte.
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
I've put it on the todo list to implement another ButtonMode "ComboBox".
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…