B4J Question Views in a panel resp. in a pane

Andie

Member
Licensed User
I'm using B4XPages, because I like the cross-platform property.

So, I defined a panel/pane as B4XView. I can go through the views belonging to this panel via a For-Each-Loop:
B4X:
For each vw as View in myPanel
    ...
next
But this works only for B4A but not for B4J (unknown type: view). What can I do to make it work for B4J, too?
 

Chris2

Active Member
Licensed User
I think you need to use myPanel.GetAllViewsRecursive.
But also, if you've declared all the views as B4XView, then you could try
B4X:
For each vw as B4XView in myPanel.GetAllViewsRecursive
    ...
next
 
Upvote 1

DonManfred

Expert
Licensed User
Unfortunately, this doesn't work. The error message "unknown type: view" still popups.
Not true!

I used it in a B4J B4XPages-Project...

B4X:
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    For Each vw As B4XView In Root.GetAllViewsRecursive
        Log($"${vw}"$)
    Next
End Sub

You are using B4J v9.10?
 
Last edited:
Upvote 0

Andie

Member
Licensed User
Thanks, DonManfred, for insisting that the solution of Chris works.
Sorry, Chris, that I didn't read your post carefully. By changing view in B4Xview everything is fine. :)
 
Upvote 0
Top