I would like to replace the text of several Textfield with code.
How can I access these views from code?
I guess something like
MainForm.RootPane ........
But I am not able to get it. (rookie)
any suggestions?
There are all kinds of ways.
Example of clearing all TextFields:
B4X:
'Add reference to XUI
Dim parent As B4XView = MainForm.RootPane
For Each x As B4XView In parent.GetAllViewsRecursive
If x Is TextField Then x.Text = ""
Next
In many cases it is better to create an array or list with the relevant views:
B4X:
Dim Fields As List = Array(TextField1, TextField2, ...)
'later
Dim tf As TextField = Fields.Get(1) 'second one
tf.Text = "abc"
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.