B4J Question [BANAno] Designing Custom Views - how to define extra parameter & execute its method?

Mashiane

Expert
Licensed User
Longtime User
Ola

When defining BANano Custom Views one has...

B4X:
Sub Initialize (CallBack As Object, Name As String, EventName As String)

and

B4X:
Sub DesignerCreateView (Target As BANanoElement, Props As Map)

I need to pass an extra variable here that will usually be in Class/Process globals that will execute just before the DesignerCreateView code is done?

For Example..
Assuming on my layout there is a control named txtfirstName of Type VueTextField, in class globals it will be

Private txtFirstName as VueTextField, now I have a dependency e.g.
Private home As VueComponent

On my initialize call,

I load the layout..
BANano.LoadLayout(#here, "layoutname")
'now my dependency call is
home.BindState(txtFirstName.VElement)

If I can pass the extra parameter, home to the custom view, then some way I could just call home.BindState(VElement) on the custom view internally. Is this possible?

Thanks
 
Top