Magma Expert Licensed User Longtime User May 29, 2025 #1 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: Code: 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 ?
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: Code: 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 ?
Solution Erel May 29, 2025 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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag
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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag
Erel B4X founder Staff member Licensed User Longtime User May 29, 2025 #2 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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag Upvote 0 Solution
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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag
Magma Expert Licensed User Longtime User May 29, 2025 #3 Erel said: 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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag Click to expand... You saved my DAY !! Upvote 0
Erel said: 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: Code: dd.GetViewByName(Root, "SwiftButton1").Tag.As(SwiftButton).Enabled = False 'or: Dim btn As SwiftButton = dd.GetViewByName(Root, "SwiftButton1").Tag Click to expand... You saved my DAY !!