1. David Peace (Powersoft)
  2. PowerBuilder
  3. Monday, 4 March 2024 15:39 PM UTC

Hi Everyone

We are retro fitting the CreateOnDemand Tab property for an application. I'm just after some clarification on what events are fired:

1. For the selected tabpages the Constructor and normal sequenece of events occurs, including the constructor for the objects on the TabPage?

2. If you use CreatePage() to create a TabPage, then the Constructor for the tabpage is fired and all the objects on the TabPage are created firing their constructors too?

I'm only asking because I'm getting code fired that is tryng to reference objects that have not yet been created and I would have thought that they would have been by that point in time. i.e. I call createpage() for a tabpage which then triggeres events and it creashed becuase DWs on the tabpage are not yet created.

I'm having trouble running the debugger to see what is happening as it just crashes PB IDE.

Any confirmation, insight welcome....

Thanks

David

PB Version 2022R3 IDE build 1900 and Runtime 1892

Accepted Answer
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 4 March 2024 16:32 PM UTC
  2. PowerBuilder
  3. # Permalink

You cannot rely on constructor events of tabpages to fire when you'd expect them. It seems to differ over different powerbuilder versions and especially when using 'create on demand'.

Not a 100% sure, but if I remember well, Ive seen retrieveEnd events of a dw on a tabpage being fired before the corresponding constructors.

 

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 5 March 2024 16:57 PM UTC
Hi David;

FWIW: For this feature, I use the IsValid ( ) command a lot to verify if related objects have been instantiated before the App interacts with them. HTH

Regards .. Chris

  1. Helpful 1
  1. Miguel Leeuwe
  2. Wednesday, 6 March 2024 10:53 AM UTC
@David, not that I'm aware of.
  1. Helpful
  1. David Peace (Powersoft)
  2. Tuesday, 9 April 2024 10:20 AM UTC
Thank you all for your helpful replies. We ended up using the DW POST constructor events to trigger the business logic. As this was the only time you coudl rely on them being available.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.