Android Question B4xTable.SetData error

makis_best

Well-Known Member
Licensed User
Longtime User
Hello all

I try to pass a list to b4xtabe using

B4X:
B4XTable1.SetData(ItemList)

But when I run the application I get the error


Why?
What it means?
 
Last edited:

josejad

Expert
Licensed User
Longtime User
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
I create the list using this code-->
B4X:
Dim N As ItemType
            N.But = ""
            N.OrderNum = Main.General1.OrderNum
            N.Gid = Main.General1.Client_GID
            N.LineAA = Main.General1.LineAA
            N.Code    = ItemTable_All_Items.GetValue(0,row)
            N.Description = ItemTable_All_Items.GetValue(1,row)
            N.Munit = ItemTable_All_Items.GetValue(2,row)
            N.Price = ItemTable_All_Items.GetValue(3,row)
            N.Quantity = ItemTable_All_Items.GetValue(4,row)
            N.Perc1 = Main.General1.Percent1
            N.Perc2 = Main.General1.Percent2
            N.AxiaProEkptosis = Total1
            N.KathariAxia = KathariAxia
            N.PosostoFPA = Main.General1.VatPercent
            N.AxiaFPA = AxiaFPA
            N.Comment = ""
            ItemList.Add(N)

I can't have type into list?
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
Have you tried with an array?

Data is a list. Each item in the list is an array of objects that represents a row.
Example
B4X:
Dim data As List
data.Initialize
data.Add(Array(1, 2, 3))
data.Add(Array(4, 5, 6))
B4XTable1.SetData(data)
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
Ok....

I understand..... So no point to use type in my code.
I change my code to fit needs of b4xtable.
Thank you.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
What about something like:
B4X:
data.Add(Array(N.OrderNum,N.Gid,N.LineAA, ...))
Remember that there are currently three types: TEXT, NUMBERS and DATES.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…