B4J Question no text in tableView

Dataverde

Member
Licensed User
Longtime User
Hey,

i cant manage to display text in a tableView.
There should be 50 rows with numbers in this screenshot, but the programm only builds the rows, not the text inside.




Here is the code:
B4X:
#Region  Project Attributes
    #MainFormWidth: 600
    #MainFormHeight: 400
#End Region

Sub Process_Globals
    Private fx As jFX
    Private MainForm As Form
    Private tv As TableView
    Private more As Button
    Private less As Button
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    MainForm.RootPane.LoadLayout("1")
    MainForm.Show
   
End Sub
Sub less_Action
    tv.Items.Clear
    For i = 0 To 5
        Dim tmpEntry(5) As String   
        tmpEntry(0) = i
        tmpEntry(1) = i*i
        tv.Items.Add(tmpEntry)
    Next
End Sub
Sub more_Action
    tv.Items.Clear
    For i = 0 To 50
        Dim tmpEntry(2) As String   
        tmpEntry(0) = i
        tmpEntry(1) = i/2
        tv.Items.Add(tmpEntry)
    Next
End Sub
Sub tv_MouseClicked (EventData As MouseEvent)
    If Not(tv.SelectedRow = -1) Then
        Dim tmpArray() As String
        tmpArray = tv.Items.Get(tv.SelectedRow)
        Log(tmpArray(0)&" - "&tmpArray(1))
    End If
End Sub

Also added the project as a zip.
The tableView example works fine.

Thanks for your time.

Lennart
 

Attachments

  • TableNoText.zip
    1.4 KB · Views: 212

Dataverde

Member
Licensed User
Longtime User
Thank you for the fast reply!
I thought that would be done by the Designer/ was done by LoadLayout
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…