C chrisinky Member Licensed User Longtime User Jun 22, 2017 #1 I need to set my tab order manually. My program connects to a server and downloads it's screen definitions on the fly (and they change often, thousands of screens). So all edittexts are drawn on the fly. I currently use the edittext.tag to store the field name given to the text box by the server so that when I send data back to the server I can tell it what text goes to what field. (So from a past example I can't set the next tab order in the tag). So currently I'm creating a map, with my tab order (0,1,2,3 etc) as the key, and my edittext box as the value (for example 0,username and 1,password). Here is my code: Code: Copy Dim nextview As View Dim t As EditText t = Sender Dim mytag As String mytag = t.Tag Dim nextup As Int nextup = datamaptaborder2.Get(mytag) nextup = nextup + 1 nextview = datamaptaborder.Get(nextup) nextview.RequestFocus I'm failing on the nextview.requestfocus line.... It's saying a string can't be cast as an android.view do I have any options here? Thnx!
I need to set my tab order manually. My program connects to a server and downloads it's screen definitions on the fly (and they change often, thousands of screens). So all edittexts are drawn on the fly. I currently use the edittext.tag to store the field name given to the text box by the server so that when I send data back to the server I can tell it what text goes to what field. (So from a past example I can't set the next tab order in the tag). So currently I'm creating a map, with my tab order (0,1,2,3 etc) as the key, and my edittext box as the value (for example 0,username and 1,password). Here is my code: Code: Copy Dim nextview As View Dim t As EditText t = Sender Dim mytag As String mytag = t.Tag Dim nextup As Int nextup = datamaptaborder2.Get(mytag) nextup = nextup + 1 nextview = datamaptaborder.Get(nextup) nextview.RequestFocus I'm failing on the nextview.requestfocus line.... It's saying a string can't be cast as an android.view do I have any options here? Thnx!
DonManfred Expert Licensed User Longtime User Jun 22, 2017 #2 chrisinky said: nextview = datamaptaborder.Get(nextup) Click to expand... i guess the result is a string, not a View What is datamaptaborder.Get(nextup)? Upload a small project which shows the problem. Without knowing your code we can´t help. Upvote 0
chrisinky said: nextview = datamaptaborder.Get(nextup) Click to expand... i guess the result is a string, not a View What is datamaptaborder.Get(nextup)? Upload a small project which shows the problem. Without knowing your code we can´t help.
C chrisinky Member Licensed User Longtime User Jun 22, 2017 #3 Thanks - I just figured it out. I was creating the map when I was reading the data from the server, thus the map was being populated with for example 0,"Fieldname" (fieldname is a string at this point). I had to create the map at the part in the sub where I create the edittext from the resulting data from the server, thus the edittext now exists and instead of passing the fieldname as a string I'm passing it as the edittext's name. Upvote 0
Thanks - I just figured it out. I was creating the map when I was reading the data from the server, thus the map was being populated with for example 0,"Fieldname" (fieldname is a string at this point). I had to create the map at the part in the sub where I create the edittext from the resulting data from the server, thus the edittext now exists and instead of passing the fieldname as a string I'm passing it as the edittext's name.