Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADDOBJECT function wipes out Controlsource on other page
Message
From
22/07/1999 20:51:13
Hermann Strijewski
Fast Track Business Solutions
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
ADDOBJECT function wipes out Controlsource on other page
Miscellaneous
Thread ID:
00245109
Message ID:
00245109
Views:
49
I ran into a weird bug today and am not sure if anyone has an answer to this one:

I have a form with a PAGEFRAME1 with 10 Pages (because it has so many controls)

In order to speed up the load time I put all controls for certain pages into a container class and add them to the page only when it is ACTIVATED.

So I have this code in the ACTIVATE method of the PAGE 8 to add the container

* Activate method of Page 8 of PAGEFRAME1
------------------------------------------------------
ASSERT NOT EMPTY(THISFORM.PAGEFRAME1.PAGE7.GRDDIAG1.COLUMN1.CONTROLSOURCE)
* ^ this condition is fine

IF TYPE("THISFORM.PAGEFRAME1.PAGE8.CONTAINER1")#"0"
THISFORM.PAGEFRAME1.PAGE8.AddObject('CONTAINER1','pmclaim_wlpplan')
ENDIF

ASSERT NOT EMPTY(THISFORM.PAGEFRAME1.PAGE7.GRDDIAG1.COLUMN1.CONTROLSOURCE)
* this fails! ^ after the ADDOBJECT for page 8, the controlsources for PAGE 7 are EMPTY!

DODEFAULT()
THIS.REFRESH()
-----------------------------------------------------

So the problem is that after the ADDOBJECT method for PAGE 8 is run, the CONTROLSOURCES for the grid in PAGE7 are wiped out!

Could that have to do with the fact that possibly for a brief moment one of the INIT methods in CONTAINER1 sets the DATASESSION to 1 and then back to what the private datasession is for that form?

Why can't I change the datasession# in a form with private datasession and then change it right back?

Sorry for so many questions at once!

Thanks again for any advice in advance!

Hermann Strijewski
Clearwater, FL
Reply
Map
View

Click here to load this message in the networking platform