B4J Question Update each View

Blueforcer

Well-Known Member
Licensed User
Longtime User
Good evening,

I need a tip on how to realise my project.

I am building a screen with controls elements.
B4X:
For Each element As Map In screenelements.Values
If element.ContainsKey("Type") Then
            Select  element.Get("Type")
                Case "ScreenButton"
                    Dim sb As ScreenButton
                    sb.Initialize("ScreenButton",p.x1,p.y1,p.x2,p.y2,element.Get("Nr"))
                    MainForm.RootPane.AddNode(sb.Base,p.x1,p.y1,p.x2,p.y2)
               Case ...

            End Select
        End If
    Next

These controls are created by the respective class.
I just get the pane from the class and insert it in the main form
This also works very well so far. But maybe the wrong way?

Now I have to update some elements that are currently displayed every 5 seconds.
Because i dont want to built the whole screen every 5s again.
I have given each class an update function.

I think the problem is that i cant add the class instance as a node, only its pane

How can I call this function for each individual element?
 
Last edited:

stevel05

Expert
Licensed User
Longtime User
Store the class object in the tag of it's pane, you can then access the class from it's pane
 
Upvote 0
Top