B4J Question How to find check value in the table.

Discussion in 'B4J Questions' started by intertech, Dec 8, 2018.

  1. intertech

    intertech New Member Licensed User

    Hi,
    How to find check value in the table.


    Code:
    #Region Project Attributes
        
    #MainFormWidth: 400
        
    #MainFormHeight: 500
    #End Region

    Sub Process_Globals
        
    Private fx As JFX
        
    Private MainForm As Form
        
    Dim TableView1 As TableView
        
    Dim Button1 As Button
    End Sub



    Sub AppStart (Form1 As Form, Args() As String)
        MainForm = Form1
        MainForm.Show
        TableView1.Initialize(
    "Table")
        Button1.Initialize (
    "button")
        Button1.Text=
    "show items are selected"
        TableView1.SetColumns(
    Array("Check","Value"))
        TableView1.SetColumnWidth(
    0,100)
        TableView1.SetColumnWidth(
    1,100)
        
        MainForm.RootPane.AddNode(TableView1,
    0,0,310,350)
        MainForm.RootPane.AddNode(Button1,
    5,360,170,30)
        
        
    For i = 0 To 10
            
    Dim b As CheckBox
            b.Initialize(
    "bu")
            b.Tag=i
            TableView1.Items.Add(
    Array(b,i))
        
    Next
    End Sub

    Sub Button1_click
        
    'VB6.0 encoding
        'For i = 0 To list1.ListItems.Count
        'If list1.ListItems(i).Checked = True Then  .............
        'Next
        
        
    'What b4j code?
        
    End Sub

    THX
     
  2. Daestrum

    Daestrum Well-Known Member Licensed User

    Code:
    Sub button_click
     
    'VB6.0 encoding
     'For i = 0 To list1.ListItems.Count
     'If list1.ListItems(i).Checked = True Then  .............
     'Next
       
     
    'What b4j code?
        For Each thing() As Object In TableView1.Items
      
    Dim tstChk As CheckBox = thing(0' col 1
      Dim value As String = thing(1'   col 2
      If tstChk.Checked Then Log("Value "&value& " checkbox is true")
     
    Next
    End Sub
     
    DonManfred likes this.
  3. intertech

    intertech New Member Licensed User

    Thanks for your explanation!
     
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