I seem to be inadvertently disabling the Accept and Cancel buttons in a B4XTextFloatField. This code works fine:
But if I uncomment that last line, this seemingly innocent sub "disables" the Accept and Cancel buttons. They appear, but do nothing when clicked. The _EnterPressed event is not fired for Accept.
Note that this sub does not touch the B4XFloatTextFields in my layout. They do not already have a Tag specified in the Designer, so I have no idea what is going on.
In case you are wondering "What the hell?" this is part of a scheme to get the fricking field name programmatically and still be able to shove something else in the "tag" value.
B4X:
EditMtgPage.Initialize("EditMtg")
Root.AddView(EditMtgPage,0,0,100%x,100%y)
EditMtgPage.LoadLayout("EditMtg")
'''' B4M.SetAllTags(EditMtgPage) ' calling this effs up Accept and Cancel buttons
But if I uncomment that last line, this seemingly innocent sub "disables" the Accept and Cancel buttons. They appear, but do nothing when clicked. The _EnterPressed event is not fired for Accept.
Note that this sub does not touch the B4XFloatTextFields in my layout. They do not already have a Tag specified in the Designer, so I have no idea what is going on.
B4X:
Public Sub SetAllTags(pView As B4XView)
LogSub("SetAllTags: " & pView.NumberOfViews)
For Each v As B4XView In pView.GetAllViewsRecursive
If v.Tag <> Null Then ' create tag map
Dim strTag As String = v.Tag
If strTag.Length > 0 And strTag.Length < 1000 Then ' i do not like this arbitrary 1000 thing
''If strTag.Length > 0 Then ' i would like this but do not know what that one big thing is. Not a Layout ...
Log("strTag: " & strTag)
Dim tagStart As Int = strTag.IndexOf("[")
If tagStart > 2 Then
Dim newTag As Object
Dim jj As Int = strTag.IndexOf2("]",tagStart)
If jj > 0 Then
newTag = strTag.SubString2(tagStart+1,jj)
Log("newTag = " & newTag)
Else
newTag = v.Tag
End If
v.Tag = newTag
strTag = strTag.SubString2(0,tagStart)
Log("new strTag = " & strTag)
End If
Dim tagMap As Map = CreateMap("vxname":strTag,"vxtag":v.Tag)
v.Tag = tagMap
End If
End If ' v.tag <> null
Log("new tag: " & v.Tag)
Next
End Sub
In case you are wondering "What the hell?" this is part of a scheme to get the fricking field name programmatically and still be able to shove something else in the "tag" value.