Private Sub IE_EnterEditMode (FC As FocusedCell)
Try
'get the row of data
Dim rowData As Map = propBag.GetRow(FC.RowId)
'get the details content
Dim sDetails As String = rowData.Get("Details")
'FC.PrevValue holds the current value. It can also be used later to revert changes
Select FC.ColumnId
Case "Value"
'use numeric
If Numbers.ContainsKey(sDetails) Then
B4XPlusMinus1.SetNumericRange(0, 100, 1)
B4XPlusMinus1.SelectedValue = FC.PrevValue
FC.View = B4XPlusMinus1.mBase
Return
End If
'use switch
If Choices.ContainsKey(sDetails) Then
Select Case sDetails
Case "Page Tag"
B4XPlusMinus1.SetStringItems(Array("div", "ion-content"))
B4XPlusMinus1.SelectedValue = FC.PrevValue
FC.View = B4XPlusMinus1.mBase
Return
Case "Active"
B4XPlusMinus1.SetStringItems(Array("yes", "no"))
B4XPlusMinus1.SelectedValue = FC.PrevValue
FC.View = B4XPlusMinus1.mBase
Return
End Select
End If
If LongText.ContainsKey(sDetails) Then
SetTextArea
TextArea1.Text = FC.PrevValue
FC.View = TextArea1
Return
End If
'default to text
SetTextField
TextField1.Text = FC.PrevValue
FC.View = TextField1
End Select
Catch
End Try 'ignore
End Sub
Private Sub IE_GetUpdatedValue (FC As FocusedCell) As Object
Try
'get the row of data
Dim rowData As Map = propBag.GetRow(FC.RowId)
'get the details content
Dim sDetails As String = rowData.Get("Details")
Select FC.ColumnId
Case "Value"
If Numbers.ContainsKey(sDetails) Then Return NumberFormat(B4XPlusMinus1.SelectedValue,1,0)
If Choices.ContainsKey(sDetails) Then Return B4XPlusMinus1.SelectedValue
If LongText.ContainsKey(sDetails) Then Return TextArea1.Text
'default to text
Return TextField1.Text
End Select
Catch
Return Null
End Try
Return Null
End Sub
Private Sub SetTextArea
Try
TextArea1.SetColorAndBorder(xui.Color_Transparent, 0, 0, 0)
Dim tf As TextArea = TextArea1
Sleep(0)
tf.SelectAll
Catch
End Try 'ignore
End Sub
Private Sub SetTextField
Try
TextField1.SetColorAndBorder(xui.Color_Transparent, 0, 0, 0)
Dim tf As TextField = TextField1
Sleep(0)
tf.SelectAll
Catch
End Try 'ignore
End Sub
Sub TextArea1_Action
Try
ie.ExitEditMode
Catch
End Try 'ignore
End Sub
Sub TextField1_Action
Try
ie.ExitEditMode
Catch
End Try 'ignore
End Sub
Sub TextArea1_TextChanged (Old As String, New As String)
' If ie.IsInEditingState And ie.CurrentlyFocusedCell.ColumnId = "Date" Then
' Try
' DateTime.DateParse(New)
' TextField1.SetColorAndBorder(xui.Color_Transparent, 0, 0, 0)
' Catch
' TextField1.SetColorAndBorder(xui.Color_Transparent, 2, xui.Color_Red, 0)
' End Try
' End If
End Sub
Sub TextField1_TextChanged (Old As String, New As String)
' If ie.IsInEditingState And ie.CurrentlyFocusedCell.ColumnId = "Date" Then
' Try
' DateTime.DateParse(New)
' TextField1.SetColorAndBorder(xui.Color_Transparent, 0, 0, 0)
' Catch
' TextField1.SetColorAndBorder(xui.Color_Transparent, 2, xui.Color_Red, 0)
' End Try
' End If
End Sub