Hi everyone, thank you for the kindness you have always shown me, I ask you for help because I don't understand why this happens with B4J:
B4X:
Public Sub LoadTableTipologie As List
Dim data As List
data.Initialize
Dim rs As ResultSet = SQL.ExecQuery("SELECT Tipologia FROM Tipologie")
Do While rs.NextRow
Dim row(1) As Object
row(0) = rs.GetString("Tipologia")
data.Add(row)
Loop
rs.Close
Return data
End Sub
B4X:
Public Sub Initialize (Parent As B4XView)
Parent.LoadLayout("Inserimento")
editCol = B4XTable1.AddColumn("Edit", B4XTable1.COLUMN_TYPE_TEXT)
editCol.Sortable = False
editCol.Width = 127dip
B4XTable1.RowHeight = 50dip
B4XTable1.NumberOfFrozenColumns = 1
DateTime.DateFormat=("yyyy/MM/dd")
B4XTable1.AddColumn("Tipologia", B4XTable1.COLUMN_TYPE_TEXT).Width = 300dip
B4XTable1.AddColumn("Descrizione", B4XTable1.COLUMN_TYPE_TEXT).Width = 300dip
B4XTable1.AddColumn("Scadenza", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.AddColumn("Note", B4XTable1.COLUMN_TYPE_TEXT)
B4XTable1.SetData(Main.LoadDataFromDB(False))
PrefDialog.Initialize(Parent, "Documenti", 600dip, 300dip)
PrefDialog.LoadFromJson(File.ReadString(File.DirAssets, "template.json"))
PrefDialog.SetOptions("Tipologia",Main.LoadTableTipologie)
PrefDialog.SearchTemplate.MaxNumberOfItemsToShow = 500
B4XTable1.MaximumRowsPerPage = 20
B4XTable1.BuildLayoutsCache(B4XTable1.MaximumRowsPerPage)
For i = 1 To editCol.CellsLayouts.Size - 1
Dim p As B4XView = editCol.CellsLayouts.Get(i)
p.AddView(CreateButton("btnEdit", Chr(0xF044)), 2dip, 5dip, 40dip, 40dip)
p.AddView(CreateButton("btnDelete", Chr(0xF00D)), 44dip, 5dip, 40dip, 40dip)
p.AddView(CreateButton("btnDuplicate",Chr(0xF0C5)), 85dip, 5dip, 40dip, 40dip)
Next
End Sub