Android Question Macros

elitevenkat

Active Member
Licensed User
Longtime User
Hi Everybody,

I have one EditText type field named "etGroupName". It is defined in the designer. The parent being "panelGroup".

I have 2 clarifications.

1. Even though "panelgroup" enabled property is False, "etgroupname" field is getting focus and allows input. How ?

2. Is there any way I could use a macro to refer to "etGroupName" like

( only a Pseudo code )

dim et as edittext
et=etgroupname ( same data type )

the code et.enabled=true - will make etgroupname.enabled property to true
the code et.text="some text". - will make etgroupname.text same as et.text

is it possible to achieve this in real code ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You can use Panel.GetAllViewsRecursive to disable all the child views.
B4X:
For Each v As View in PanelGroup.GetAllViewsRecursive
 v.Enabled = False
Next

2. You will need to use a Map for that.
B4X:
Dim MapOfViews As Map
MapOfViews.Initialize
MapOfViews.Put("etgroupname")
...
Dim et As EditText = MapOfViews.Get("etgroupname")
 
Upvote 0
Top