For each value as string in dataset.values
Sub JobDone (job3 As HttpJob)
Log("JobName = " & job3.JobName & ", Success = " & job3.Success)
ProgressDialogHide
' Job.GetRequest.Timeout = 60000
If job3.Success Then
Select job3.JobName
Case "Billing"
' Log(job1.GetString)
Dim parser As JSONParser
Dim response As String = job3.GetString
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
For i = 0 To rows.Size - 1
Log("Rows #" & i)
Dim m As Map
m = rows.Get(i)
Log("Itemcode=" & m.Get("ItemCode"))
Log("Itemname=" & m.Get("ItemName"))
Dim valuesdata As List
valuesdata.initialize
For Each value As String In m.values
valuesdata.add(value)
Next
ACEdtCode.SetItems(valuesdata)
Next
End Select
End If
job3.Release
End Sub
** Activity (billing) Resume **
JobName = Billing, Success = true
Rows #0
Error occurred on line: 226 (Billing)
java.lang.ClassCastException: java.util.ArrayList
at anywheresoftware.b4a.objects.collections.Map.Get(Map.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
What is the log response ofCase "Billing"
Dim parser As JSONParser
Dim response As String = job3.GetString
parser.Initialize(response)
Dim rows As List
rows = parser.NextArray
Log(response)
Dim parser As JSONParser
Dim response As String = job3.GetString
parser.Initialize(response)
Log(response)
Dim rows As List
rows = parser.NextArray
For i = 0 To rows.Size - 1
Dim m As Map
m = rows.Get(i)
valuesdata.Initialize
valuesdata2.Initialize
valuesdata.Add(m.Get("ItemName"))
valuesdata2.Add(m.Get("Itemcode"))
Log(valuesdata)
Log(valuesdata2)
Next
ACEdtCode.SetItems(valuesdata2)
ACEdtItem.SetItems(valuesdata)
i guess it is because .Text contains a word that match one entry in your auto complete list.
So how can i solve this.
Dim response As String = job3.GetString
parser.Initialize(response)
Log(response)
valuesdata.Initialize '<- initialize this list just once
valuesdata2.Initialize '<- same as this
Dim rows As List
rows = parser.NextArray
For i = 0 To rows.Size - 1
Dim m As Map
m = rows.Get(i)
' valuesdata.Initialize '<- this should not be here
' valuesdata2.Initialize '<- this neither
valuesdata.Add(m.Get("ItemName"))
valuesdata2.Add(m.Get("Itemcode"))
Log(valuesdata)
Log(valuesdata2)
Next
ACEdtCode.SetItems(valuesdata2)
ACEdtItem.SetItems(valuesdata)