Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Feb 14, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Order Objects Constructed on a Window

I have a number of datawindows in a window. In a post-construct event I am making a call to another datawindow. Every so often when I open the window I get an error saying that the reference to the second datawindow is invalid. I think this is because the second datawindow has not been created yet. How can I adjust the order of the creation of the objects?

You are correct in your assumption that the datawindow is not constructed and is causing your problem. If you move the code to the parent level (i.e. window) you will not get this problem.

The sequence in which the controls is created is based on their layering within the window painter. You could make sure this sequence is always correct but it is better practice not to rely on this behavior.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date