Android Question [SOLVED] B4XTable not show buttons in column

Discussion in 'Android Questions' started by makis_best, Apr 30, 2019.

  1. makis_best

    makis_best Active Member Licensed User

    I have B4XTable and in the first column I want to add two buttons.
    I insert rows from a list successfully but the first column stay always blank.

    What I am doing wrong?

    Code:
    Sub Activity_Create(FirstTime As Boolean)
    ...
    ...
    ...
        editCol = B4XTable1.AddColumn(
    "Edit", B4XTable1.COLUMN_TYPE_TEXT)
        editCol.Sortable = 
    False
        editCol.Width = 
    127dip
        B4XTable1.RowHeight = 
    55dip
        B4XTable1.AddColumn(
    "Code", B4XTable1.COLUMN_TYPE_TEXT)
        B4XTable1.AddColumn(
    "Description", B4XTable1.COLUMN_TYPE_TEXT)
        LoadGeneralClassDataList
    ...
    ...
    ...
    End Sub
    Code:
    Sub LoadGeneralClassDataList
        B4XTable1.SetData(ItemListSelection)
        
    For i = 1 To editCol.CellsLayouts.Size - 1
            
    Dim p As B4XView = editCol.CellsLayouts.Get(i)
            p.AddView(CreateButton(
    "btnEdit"Chr(0xF044)), 2dip5dip40dip40dip)
            p.AddView(CreateButton(
    "btnDelete"Chr(0xF00D)), 44dip5dip40dip40dip)
        
    Next
    End Sub

    Sub CreateButton (EventName As String, Text As StringAs B4XView
        
    Dim Btn As Button
        
    Dim FontSize As Int = 14
        Btn.Initialize(EventName)
        
    Dim x As B4XView = Btn
        x.Font =  xui.CreateFontAwesome(FontSize)
        x.Visible = 
    False
        x.Text = Text
        
    Return x
    End Sub
     
    Last edited: Apr 30, 2019
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. makis_best

    makis_best Active Member Licensed User

    Erel... That's the example I use but not working for me...
    No errors no nothing but also no buttons.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Run the example as-is. Do you see the buttons after you add an item?
     
  5. makis_best

    makis_best Active Member Licensed User


    I see buttons exactly as you say..

    You mean that I need to add them one by one not to insert them with list?
     
    Last edited: May 1, 2019
  6. makis_best

    makis_best Active Member Licensed User

    Erel you are the best I find the problem.
    I needed to use DataUpdated.

    Thank you.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice