Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Order Objects Constructed on a Window

Question:
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?

Answer:
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.

 

 

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