Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Integration SDT - MM
Message
 
À
25/05/1998 10:37:44
Jaco Van Der Laan
Consilium Information Systems B.V.
Rotterdam, Pays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00101661
Message ID:
00101787
Vues:
23
Jaco,

>I would like to integrate SDT with Mere Mortals CodeBook to automaticly fill in properties from the data dictionary into the controls, like the caption, format, width etc.>

>The problem is that when I put this in the Init() event, the Business Object is not instantiated yet.

In Visual FoxPro all objects contained on a form instantiate before the form's Init() method is executed...this includes business objects.

If you are issuing DODEFAULT() before running your code then the business object processing is also taking place before your code is executed. What error are you encountering that makes you suspect the business object is not instantiated?

If you want to make sure that a business object instantiates (and loads its associated cursors) before any form controls, you can select the business object and "Send to Back". However, remember that a form's RefBizObj must be instantiated before any business objects so you'll need to send the RefBizObj "To Back" afterwards. See the section "A Word about ZOrder" in the Mere Mortals Developer's Guide for details.

As an aside, you may want to check how long it takes to run this code when there are many controls on a form. Although data driving the application with SDT extended properties makes your application easier to maintain, you should weigh that against any associated speed hit.

If you *do* decide to data-drive your application you may want to consider adding generic code to your form controls' Init() rather than instance-specific code in the form's Init(). This will also allow your SDT code to work when adding controls to a form dynamnically at runtime. Check out the Stonefield Database Toolkit manual under the heading "Creating Data-Driven Applications" for details. You could create subclasses of the Mere Mortal framework's User Interface controls in the same way Doug describes.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform