I was thinking (given that I don't know that "rootpane") that probably it is like the B4A ScrollView, then you should use the "same method": get the internal panel and apply GetAllViewsRecursive to it.
I was testing when...
B4X:
If sp.InnerNode = Null Then
Log("is null")
Else
Log("is NOT null")
End If
Log(GetType(sp.InnerNode))
sp is an empty ScrollPane, but the first log writes "is NOT null", the second raises an error because... InnerNode is not initialized!
rootpane is the anchor pane of the MainForm, and it has a getallviewsrecursive, but, scrollpane method, wich is also an achor pane, does not have such a method, thou we can load a layout to it... so I need to find a way to get the scrollpane child nodes (views)
yes, I saw that one after your last reply, but I'm getting an error just by adding the dim line!
B4X:
Program started.
main._initializeandbuildmaps (java line: 119)
java.lang.RuntimeException: Object should first be initialized (Node).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:32)
at b4j.example.main._initializeandbuildmaps(main.java:119)
at b4j.example.main._openlayout_action(main.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
at anywheresoftware.b4a.BA$2.run(BA.java:165)
at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
The simplest way to fill a ScrollPane is by calling ScrollPane.LoadLayout. This will create a Pane, set it as the inner node and load the layout file to this pane.
Later you can iterate over the views with:
B4X:
Dim p As Pane = ScrollPane1.InnerNode
For Each n As Node in p.GetAllViewsRecursive
Next
Hi Luca, I haven't been able to test any further, its been a hard week and not much time to code, but Erel has shed some light on the subject in his last post.