Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding a ComboBox to AToolBar
Message
 
To
09/02/1999 09:58:04
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00185202
Message ID:
00185534
Views:
20
Rex,

>What I am trying to do is keep some information globally (in this case a clinic id number) which could be changed regardless of the form I am currently viewing. Wouldn't I need a bizobj to populate the combo?>

As BOb mentioned, you could add the business object to the application object. This will load its associated view in the "Default" data session. Since toolbars also use the default data session, your combobox will always have access to the business object's view as its RowSource.

However, here's the catch: If you add/edit/delete records in the view, you'll need to issue a Requery() to the combobox so that it picks up the change in its RowSource. Typically, you place code in a business object's PostRequeryHook() method to issue a Requery() to the combobox. That way, you can guarantee that whenever the business object is requeried, the combobox is requeried and kept in synch.

That said, you don't want to place UI-specific code in a business object's method until you have dropped an instance of the class into a form / container. This presents a case for dropping an instance of your business object inside the toolbar rather than adding it to the application object dynamically at runtime.

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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform