Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddViewParameter enhancement? (repost)
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00401557
Message ID:
00402446
Views:
9
Dr. Weider,

>Right now, what I'm doing whenever I have a parameter whose value might change is to assign it to a property of the form and then keep changing the property as I need, but I thought it would be easier to simply build some smarts into the bizobj and have AddViewParameter deal with changes as well as additions.>

Actually, to make your business objects scalable you shouldn't save your view parameter values to a form property...when the UI goes away so goes the property! It builds a dependency between user interface and business object that is undesirable.

I recommend storing your view parameter values in properties of the business object instead...it's the one thing you can count on being there!

Rather than having your client code store the value directly to a business object property, you can create a method...let's call it FetchData() on your business object that accepts a unique ID. Create a corresponding "iUniqueID" PROTECTED property on your business object and place the following code in FetchData() that places the specified value in the business object property for you, then issues a Requery():

*---------------------------
* FetchData()
*---------------------------
LPARAMETERS tiUniqueID

This.iUniqueID = tiUniqueID
This.Requery()
*---------------------------

Next, place the following code in your business object's PostInitHook()

*---------------------------
* PostInitHook()
*---------------------------
This.AddViewParameter("vp_iUniqueID", "This.iUniqueID")
*---------------------------

Oui?
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