Sub B4XTableM_CellClicked (ColumnId As String, RowId As Long)
Dim column As B4XTableColumn = B4XTableM.GetColumn(ColumnId)
Dim value As String = B4XTableM.GetRow(RowId).Get(ColumnId)
Dim visibleRowID As Int = (B4XTableM.VisibleRowIds.IndexOf(RowId))
ClickedRow=RowId
ClickedCol=column.SQLID
Select ColumnId
Case "paydate" , "duedate"
'will use a datepicker here
Case "cycle", "method", "autopay"
Log("Case cycle method autopay")
cBox.Items.Clear
cBox.Top = visibleRowID * 10+100
Select ColumnId
Case "cycle"
Log("Case cycle")
cBox.Left=250
cBox.items.AddAll(Array As String("Monthly", "1st&15th", "Weekly","Special","None","2ndWed","3rdWed","Bi-Month"))
Case "method"
cBox.Left=250
cBox.items.AddAll(Array As String("Chk/DebitC", "Draft", "None","Online","OnlineCC","DraftCC"))
Case "autopay"
cBox.Left=320
cBox.items.AddAll(Array As String("None", "Fixed", "Min","Min+","Stmt"))
End Select
Log("cBox.Visible =True & cBox.ShowChoices")
cBox.ShowChoices
cBox.Visible=True
Case Else
If InputTemplate.IsInitialized = False Then InputTemplate.Initialize
InputTemplate.Text = value
InputTemplate.lblTitle.Text = ColumnId 'line 118 error column.Id = 'description' InputTemplate is all null's except for Text which is = 'AT&T'
Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
B4XTableM.sql1.ExecNonQuery2($"UPDATE data SET ${column.SQLID} = ? WHERE rowid = ?"$, Array As String(InputTemplate.Text, RowId))
B4XTableM.Refresh
End If
End Select
End Sub
Sub cBox_SelectedIndexChanged(Index As Int, Value As Object)
Log("cBox_SelectedIndexChanged(Index As Int, Value As Object)" & "-" & Index & "-" & Value )
Dim myquery As String = "UPDATE data SET " & ClickedCol & " = '" & Value & "' WHERE rowid = " & ClickedRow
B4XTableM.sql1.ExecNonQuery(myquery)
cBox.Visible=False
Log("B4XTableM.Refresh")
B4XTableM.Refresh
End Sub