Objects do not finish initialization until they are added to a parent, and
may take even longer. See the docs on custom components and the component
Even if I add to a parent it doenst work until the widows is showed. Is there a way to force initialization?
Maybe you should listen for a creation complete event on MyComp, and only then access the textinput ?
Or call validateNow.
But in general, it is best not to push data to sub-components. It is not
good OO practices. The sub-components should pull their data from a data
model, which can be implemented on the component API or in a shared data
model. If implemented on the component, there are standard practices using
the invalidation/validation APIs to proxy that data to sub-components.