The answer to this question is here in the Custom View guide.
2) if the caller loads a layout with a custom view, the view is not actually fully initialised when control is passed back to the caller.
so,
B4X:
p.loadlayout("Datecontrolayout")
datecontrol.date = datetime.now
if the setDate function attempted to update an element of the loaded view immediately, there would be an "object not initialised" error, hence the need to delay the update of the visual control, until it has been fully initialised.
3) Which events have you tried? What happens?