B4J Question [ABMaterial] problem with table

MichalK73

Well-Known Member
Licensed User
Longtime User
Hello.
I have a problem with ABTable.
I do not have table_Clicked or highlighting the selected row, sort.
Surprisingly, Demo does not work like in my program.
But on DEMO online abmaterial.com everything works fine.
What can be predictable?

B4X:
    Dim tablica As ABMTable
    Dim lista As List = DBM.SQLSelect(DBM.GetSQL, "select * from moderator")
    tablica.Initialize(page, "tbl1", True, False,True, "tbl1theme")
    tablica.SetFooters(Array As String("Wszystkich: "&lista.Size))
    tablica.SetHeaders(Array As String("Nazwa", "Code", "Opis", "Aktywny","Usuń"))
    tablica.SetColumnWidths(Array As Int(120,100,120,50,50))
    tablica.SetColumnDataFields(Array As String("Nazwa", "Code", "Opis", "Aktywny","Usuń"))
    tablica.SetFooter("Wszystkich: "&lista.Size, 12, "tbl1theme")
    tablica.SetFooterThemes(Array As String("headerfooter"))
    For i = 0 To lista.Size-1
        Dim m As Map = lista.Get(i)
        Dim act As Boolean
        If m.Get("active") = "1" Then
            act = True
        Else
            act = False
        End If
        Dim r As List
        r.Initialize
        r.Add(m.Get("name"))
        r.Add(m.Get("code"))
        r.Add(m.Get("opis"))
        Dim switchactive As ABMSwitch
        switchactive.Initialize(page, "sw11", "On", "Off", act, "")
        switchactive.Tag = m.Get("name")
        switchactive.State = act
        r.Add(switchactive)
        Dim dele As ABMButton
        dele.InitializeFlat(page,"del","mdi-action-delete",ABM.ICONALIGN_CENTER,"","")
        r.Add(dele)
        
        tablica.AddRow(m.Get("name"),r)
        'tablica.SetRowThemes(Array As String("nocolor","nocolor","nocolor","nocolor"))
    Next
    tablica.IsResponsive = True
    page.Cell(1,1).AddComponent(tablica)

B4X:
Sub tbl1_Clicked(PassedRowsAndColumns As List)
    Dim tblCellInfo As ABMTableCell = PassedRowsAndColumns.Get(0)
    If tblCellInfo.Column = 4 Then
        Log("a")
    End If
End Sub

table_error.png
 

MichalK73

Well-Known Member
Licensed User
Longtime User
I just fired Demo 4.03 and these are errors. I did not change anything.
Whether it's Debug or Release it does not work.
.needs is together with .jar.

Where can I find the appropriate css / js / font? Because I took from the Template project in package 4.03.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Size folder js in Demo - 9056kB
Size folder js in Template - 9128 kB
Which good?

both. One can be bigger than the other because of custom components.

Have you tried pressing CTRL + F5? (clear the cache)
What does the network tab in the console say (are there missing files?)
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
table_error2.png table_error3.png

Yes I clear all cache in browser.
Testing na Chrome, Opera and IE , nothing works.
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Sorry if I would state the obvious, but I'm also puzzled here. Everything looks fine to me too.

If you put in your page:

B4X:
Sub Page_ParseEvent(Params As Map)
   Dim eventName As String = Params.Get("eventname")
   Dim eventParams() As String = Regex.Split(",",Params.Get("eventparams"))
   Log(eventName) ' <------------

And you click a row, is an event logged? (e.g. something like tbl1_Clicked)
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
I have
"tbl1_0_3___clicked" in Log(eventName)

There is nothing for the clicked row event. It occurs only as a click in the line on 'switch' or button.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Just remembered, have you put ABM.EnablePassiveEventListeners = false in ABMApplication?

see https://www.b4x.com/android/forum/t...-on-smaller-devices-mobile.86792/#post-549620 as it relates to an experiment to speed up events, but did not work.

"tbl1_0_3___clicked"
This is correct I think, because further in the ParseEvent method, it should split it up to "tbl1" in:

B4X:
If Params.get(eventParams(0)) = "abmistable" Then

Maybe put a break at this line and see what the result is.
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
F ** ck. Sorry. Library 4.03 I had thrown into LibraryOther but in Library B4J I had thrown 4.0 !!!!!! B4J searched the library first at LIbrary B4J and avoided it at LIbraryOthers !!!
My goddamn mistake.
Everything works now. My stupidity !!!
Thread is closing.
 
Upvote 0
Top