B4A Library [Class] Flexible Table

vbmundo

Well-Known Member
Licensed User
Hi,

Are any way to use Column AutoAdjust ? My APP fill a Table from an SQL Stattement but I can't know the size of every field, because is the USER who write this SQL Stattement.

And... How many DIP have every characters ?

Regards
 

klaus

Expert
Licensed User
Longtime User
Sorry, but I don't understand what exactly you mean.
Is your database a SQLite database.
If yes, with LoadSQLiteDB(SQLite As SQL, Query As String, AutomaticWidths As Boolean) you can have an automatic width adaptation.
 
Last edited:

vbmundo

Well-Known Member
Licensed User
I can realize that to a large load of records, the cell reaches 100% CPU LOAD.

Is there any way to paginate results that ranks with new results recreate forward or back before pressing buttons?
 

klaus

Expert
Licensed User
Longtime User
Is there any way to paginate results that ranks with new results recreate forward or back before pressing buttons?
I don't understand what exactly you mean, do you mean generate rows in the ScrollView or loading rows from the database?
In the Table Class not all rows are generated at once they are recreated dynamically that was the main purpose when Erel created this class.
But the data must exist for all rows.
Splitting the loading from the database is not supported in the class.
 

klaus

Expert
Licensed User
Longtime User
What's wrong ?
I don't know.
Which version do you use? The latest is 1.43.
I retested the latest version and the the click event is raised also from the last line.

Can you post your project, or better a small one showing the problem, so I can have a look at it.
 

vbmundo

Well-Known Member
Licensed User
I don't know.
Which version do you use? The latest is 1.43.
I retested the latest version and the the click event is raised also from the last line.

Can you post your project, or better a small one showing the problem, so I can have a look at it.

Hi, I have the 2.0 version

The last row doesn't raise the Click Event
 

vbmundo

Well-Known Member
Licensed User
Hi ,

I have problems with the Table, when I fill with over 1000 records, the Table show wrong info after Scroll

data have repeated indefinitely

I haven't any Database problem, and in Log I can see all Diferent IDs

I think when you try to make a Scroll of a table with more than 1000 rows there is an internal problem .. always ends up showing the same labels

My Code is this

B4X:
Sub TablesSQL_Result(data As List, meta As Map)
    Dim m As Map, i As Int
    Dim mm As Map
   
    Try
        If data.Size=0 Then
            Msgbox("your query returned no results","No Data")
            Activity.Finish 
        End If
        m.Initialize
        m=data.Get(0)
        Dim Campos(m.size) As String
        Dim Cabeceras(m.Size) As String
   
        ' Formateo Tabla
   
        g.Initialize(Me,"g")
        g.InitializeTable(m.size,0,False)
        g.AddToActivity(Activity , 0, 50dip, 100%x, 80%y)

        For i=0 To m.Size-1
            Cabeceras(i)=m.GetKeyAt(i)
        Next
        G.SetHeader(Cabeceras)
   
        ' Leo Registros
   
        For i = 0 To data.Size-1
            mm=data.Get(i)
            Log(mm.GetValueAt(0))
            For ii = 0 To mm.Size-1
                Campos(ii)=mm.GetValueAt(ii)
            Next
            G.AddRowAutomaticWidth(Campos)
        Next
           ProgressDialogHide
        lblCantRegistros.Text=data.size & " Rows "
       
    Catch
        Log(LastException)
        If LastException.Message.Contains("Java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0")=True Then
            Msgbox("Your Query has not return any row. Remember that Empty Date Fields '0000-00-00' not return Null Dates. You must Include a Conversion into your SQL Stattement","Help")
        End If
        Msgbox("An Error has occurred. " & LastException.Message ,"Error")
    End Try
 
End Sub

What's wrong ?

Thanks
 

vbmundo

Well-Known Member
Licensed User
Do you call TablesSQL_Result several times ?
If yes, this means that you add at every call a new table.

Can you post a small project showing the problem.

Hi, No.. I call this routine only one time.

I can't give you a project, because I can't give you my DB Credentials

This is the code.. and the LOG section show the right info..

Regards
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…