Hello everyone. So right now i want to make a loop to get all item selected. Im using map to pass the data into the server. So here is my code. Any idea ?
B4X:
Dim dpList As List
dpList.Initialize
Dim i As Map
i.Initialize
i.Put("ITEM_QTY", txtQte.Text)
i.Put("ITEM_AMT", SumWithoutCurrency(lblDashOrderSubTotal.Text.Trim))
i.Put("ITEM_TAX", SumWithoutCurrency(lblDashTaxCharges.Text.Trim))
i.Put("ITEM_ID",item)
i.Put("MINAME", ProductName)
i.Put("ITEM_TOPPING_TOTAL", "")
i.Put("ITEM_TOTAL_PRICE", SumWithoutCurrency(lblDashOrderGrandTotal.Text.Trim))
dpList.Add(i)
m.Put("Items", dpList)
Dim params As String
params = UTILS.convertJson(m)
Dim jobVerif As HttpJob
jobVerif.Initialize("", Me)
jobVerif.PostString(Main.apikey",params)
jobVerif.GetRequest.SetContentType("application/json")
Wait For (jobVerif) JobDone(Job As HttpJob)
If jobVerif.Success Then
Log(Job.GetString)
Dim parser As JSONParser
parser.Initialize(Job.GetString)
Dim rRoot As Map = parser.NextObject
Toast.Show(rRoot.Get("Message").As(String))
Else
Toast.Show("AN ERROR OCCURED. PLEASE CHECK YOUR INTERNET CONNECTION !")
End If
jobVerif.Release