Android Question DDD and SwiftButton

Magma

Expert
Licensed User
Longtime User
Hi there,

using lately DDD.CollectViewsData...
well thought it was easy to enable and disable SwiftButtons... but it seems different because Swiftbuttons are B4X CustomViews...

so the following not works:
B4X:
dd.GetViewByName(myb4xview,"SwiftButton1").Enabled=False

Also my swiftbutton is a part of a layout loading/createitem with customlistivew... so "problem" gets harder

any idea for it ?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Related: https://www.b4x.com/android/forum/t...om-clv-or-any-other-container.117992/#content

GetViewByName returns a B4XView, which means that it doesn't return the custom view, but rather the base panel.
With most custom views, you can get the custom view from the Tag property:
B4X:
dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False
'or:
Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag
 
Upvote 0
Solution

Magma

Expert
Licensed User
Longtime User
Upvote 0
Top