B4J Question I don't understand why this happens with B4J

Angelo Messina

Active Member
Licensed User
Longtime User
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

Screenshot (1).png
 

Angelo Messina

Active Member
Licensed User
Longtime User
Template
B4X:
{
    "Version": 1.1,
    "Theme": "Light Theme",
    "Items": [
        {
            "title": "Tipologia",
            "type": "Separator",
            "key": "",
            "required": false
        },
        {
            "title": "Tipologia",
            "type": "Options",
            "key": "Tipologia",
            "required": true
        },
        {
            "title": "Descrizione",
            "type": "Text",
            "key": "Descrizione",
            "required": true
        },
        {
            "title": "Scadenza",
            "type": "Date",
            "key": "Scadenza",
            "required": true
        },
        {
            "options": [
                "Nuovo",
                "Esistente",
        "Completato"
            ],
            "title": "Note",
            "type": "Short Options",
            "key": "Note",
            "required": true
        }
    ]
}
 
Upvote 0
Top