By name?

ilan

Expert
Licensed User
Longtime User

mangojack

Expert
Licensed User
Longtime User
One thing I didn't understand, how or where is "dd" initialized?
I can't find any information.

dd refers to the DesignerUtils (DDD) class
B4X:
Private dd As DDD

Then later in App_Start or Page_Create (B4J ...) it is initialised ,
B4X:
dd.Initialize
   
'The designer script calls the DDD class. A new class instance will be created if needed.
'In this case we want to create it ourselves as we want to access it in our code.
xui.RegisterDesignerClass(dd)

the latest xCLV example shows everything required to get up to speed.
 
Last edited:

mangojack

Expert
Licensed User
Longtime User
One thing I did notice in the example was the older method to change / access a views property ..
B4X:
Dim lbl As B4XView = dd.GetViewByName(pnl, "Label1")
lbl.Text = "Clicked!"

whereas you are still able to access the property directly ...
B4X:
dd.GetViewByName(pnl, "Label1").Text = "Clicked!"
 

LucaMs

Expert
Licensed User
Longtime User
One thing I did notice in the example was the older method to change / access a views property ..
B4X:
Dim lbl As B4XView = dd.GetViewByName(pnl, "Label1")
lbl.Text = "Clicked!"

whereas you are still able to access the property directly ...
B4X:
dd.GetViewByName(pnl, "Label1").Text = "Clicked!"
That is because GetViewByName returns a B4XView.
Also, you should still be able to use the "As" keyword (inline casting):
B4X:
dd.GetViewByName(pnl, "Panel1").As(Panel).Elevation = 6
 
Top