B4A Library [Class] Flexible Table

vbmundo

Well-Known Member
Licensed User
Hi, I sent to you my entire project by Private.

I send to you My Trial DataBase Credentials and you must

1. Connect to this DataBase.
2. Choose QUERY
3. Run "SELECT * FROM videos"

And when the query finish (take over 2 minutes) try to scroll your Table control.

Thanks a Lot
 

vbmundo

Well-Known Member
Licensed User
Hi Klaus

I have the same problem with an only 29 records table.

And the SAVETOCSV doesn't work.. this option save the same record repeated a lot of times.

Regards
 

vbmundo

Well-Known Member
Licensed User
Hi

I have several problems with your lib.

On Every click in one cell, the data is changed .

This happend in every attempt.

I has remove this Grid in 2 Activities and replace this with a ListView, but in the last Activity I need to show several rows and columns..

Can you check to click a table with AutoWidth rows added ?

Regards
 

vbmundo

Well-Known Member
Licensed User
I use a non FREE MySQL lib to fill this tables...

I ask to you about a CLICK EVENT issue in your lib.. when you have a TABLE that exced the Screen size and you need scroll this every click event fail...

You click on cell and the value change... and you have left a lot of repeted values.

You don't need a small project, you need to use your lib and try to click in one cell.

Sorry but is your lib, not my lib.

Regards
 

klaus

Expert
Licensed User
Longtime User
I tested the Table and it works as expected.
Therfore I cannot help because I cannot reproduce your problem.

Sorry but is your lib, not my lib.
It's not my class either.
The original class was written by Erel.
I added some features in this version.
Then Melamoud created this thread, but he is no more active in the forum.
I continue to maintain it.
And to be able to update new versions in the first post Erel changed me as the owner of this first post.
 

vbmundo

Well-Known Member
Licensed User
I'm debuging the Table Code.

When you click into a Cell, this control delete the entire row of labels and then recreate the new ones, with different colors.

When Delete the row (for example ROW 2) and recreate the new one, for any reason, this control take the Entire data of the ROW 3 and duplicate it into the NEW ROW 2)

This is a Control BUG... is not my project or my MySQL Controls...

Do you Understand ? when you DELETE the Row 2...

B4X:
Private Sub HideRow (Row As Int)
    'Log("HideRow: " & Row)
    Dim lbls() As Label
    lbls = visibleRows.get(Row)
    If lbls = Null Then
'        Log("HideRow: (null) " & Row)
        Return
    End If
    For I = 0 To lbls.Length - 1   
        lbls(I).RemoveView
    Next
    visibleRows.Remove(Row)
    LabelsCache.Add(lbls)
End Sub

THIS IS THE lbls = GetLabels(Row) Instruction

ROW 2 , have DELPHI info



THE NEXT INSTRUCTION IS values = Data.get(Row)

THE SAME ROW, BUT YOUR CONTROL RETRY DIFERENT DATA



THIS COBOL DATA, CORRESPOND TO THE NEXT ROW (I CLICK IN THE 2ND ROW, AND THE COBOL DATA IS IN THE 3RD ROW)

Maybe EREL need to see this...

Thanks
 

vbmundo

Well-Known Member
Licensed User
This is the principal BUG

For this reason... the scroll fails , and I has to quit this control of 2 activitys..

If Erel fix this Issue, this TABLE will the Holy Grial
 

vbmundo

Well-Known Member
Licensed User
DATA is the PROBLEM...

in Public Sub AddRowAutomaticWidth(Values() As String)

I debug and see 4 rows, with diferent VALUES,

But then DATA have 4 rows, with the same set of values... the Last values...
 

klaus

Expert
Licensed User
Longtime User
I had a closer look on your problem, I can reproduce it now and will look at it.
I suggest you to replace:
B4X:
For i = 0 To data.Size-1
    '
    '
    g.AddRowAutomaticWidth(Valores)
    g.RowHeight=35
    If Defa="auto_increment" Then MySQL.TieneAutoIncrement=True
Next
by
B4X:
g.RowHeight=35dip
For i = 0 To data.Size-1
    '
    '
    g.AddRow(Valores)
    If Defa="auto_increment" Then MySQL.TieneAutoIncrement=True
Next
g.SetAutomaticWidths
This will be more efficient.
You should move g.RowHeight=35 out of the loop and before it and replace 35 by 35dip.
 

vbmundo

Well-Known Member
Licensed User
Thanks Klaus,

But the problem is the DATA list .

I will debug line by line in some hours..

because DATA is fed with real and correct values. (I could debug it)

But then .. (not that SUB) something happens, and DATA is filled with the same INFO again and again.

Specifically, the last ROW read ...

So

You have 5 rows .... and the last is a fact about "Giraffes"

and you end up having the whole list DATA with the "Giraffes" ..

You understand?
 

vbmundo

Well-Known Member
Licensed User
Hi ,

Look.. this is the DATA list from your Control after CLICK



COBOL is the LAST row... and when you click (for example) in ROW 2.. and see the Entire DATA list.. you can see this... the last row repeated in all rows.

I hasn't modify or touch your TABLE.BAS file..

Can you help me ?

thanks
 

klaus

Expert
Licensed User
Longtime User
Can you try the attached project.

I could reproduce your problem once with the program I use to test the Table Class.
I added a filling routine similar to yours.
And the strange thing now, with exactly the same program it works as expected after several testing.
Can you try your project in Release mode.

In what module is your Click event ?
 

Attachments

  • TableV2_10.zip
    47.3 KB · Views: 201
Cookies are required to use this site. You must accept them to continue using the site. Learn more…