B4J Question GetName

Mashiane

Expert
Licensed User
Longtime User
Hi

I'm trying to get the real name of a combobox, textarea, textfield, checkbox etc.

This is what I'm getting...

B4X:
Get Components
(TextField) TextField@1c0e110[styleClass=text-input text-field]
(TextField) TextField@1f9f2fb[styleClass=text-input text-field]
(TextField) TextField@4e90bd[styleClass=text-input text-field]
(TextField) TextField@2770dd[styleClass=text-input text-field]
(TextField) TextField@1aa6a30[styleClass=text-input text-field]
(CheckBox) CheckBox@325e80[styleClass=check-box]'Active'
(ComboBox) ComboBox@160219f[styleClass=combo-box-base combo-box]
(CheckBox) CheckBox@ad3d2d[styleClass=check-box]'Static'
(ComboBox) ComboBox@553e3e[styleClass=combo-box-base combo-box]
(TextField) TextField@991f14[styleClass=text-input text-field]
(ComboBox) ComboBox@f760f0[styleClass=combo-box-base combo-box]
(ComboBox) ComboBox@54253b[styleClass=combo-box-base combo-box]
(ComboBox) ComboBox@8b10c1[styleClass=combo-box-base combo-box]
(ComboBox) ComboBox@6f31b5[styleClass=combo-box-base combo-box]
(CheckBox) CheckBox@133aa88[styleClass=check-box]'Collapsed'
(ComboBox) ComboBox@1b5a81f[styleClass=combo-box-base combo-box]
(TextField) TextField@c74472[styleClass=text-input text-field]
(ComboBox) ComboBox@132b7ec[styleClass=combo-box-base combo-box]
(TextField) TextField@1df92e5[styleClass=text-input text-field]

This is my GetComponents method...

B4X:
Sub GetComponents
    Log("Get Components")
    For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
         If n Is TextField Then
            Log(n)
        End If
        If n Is ComboBox Then
            Log(n)
        End If
        If n Is TextArea Then
            Log(n)
        End If
        If n Is CheckBox Then
            Log(n)
        End If
    Next
   
End Sub

Like I want to get the name e.g. txtFirstName if the name is associated to be that in the designer. Is it possible?
 
Top