Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Write findform once, use many times
Message
From
13/04/2004 07:46:35
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Write findform once, use many times
Miscellaneous
Thread ID:
00894359
Message ID:
00894359
Views:
42
Hi,

In my Apps I almost always use BizObj maintenance forms (cbizobjnolistmaintform) and an associated FindForm to select the Business object. Very often the same business object appears as a child item in the maintenance form of another BizObj. This business Object then appears in a control (combobox, textbox,...) on the associated clistobjeditform
In order to reuse the FindForm I mentioned in the beginning, I use my own control which is essentially a combobox control with 2 columns bound to the 2nd non visual column and a button with caption "..." (ellipses button)
that launches ThisForm.FindFormActivate() when clicked. If no combobox behaviour is wanted, I move the button over the down arrow on the right of the combobox.
The only thing you've got to do is to fill in the cFindForm properties cprimaryviewparameter and cprimaryviewparameter (e.g.thisform.cmbMyControl.comboBox.Value) and the findform picks the keyvalue and fills it in the control which results in the
display of the descriptive text field visible to the user.

The only thing that has to be changed to the framework is to add additional check in the findprocess method of the clistobjeditform. The findprocess is conceived to populate a BizObj on a BizObjForm. However, the clistobjeditform has no BizObj.


- If there's a more elgant way that I'm not aware of, to accomplish the same thing (write findform once, use many times), I'd like to know how this is to be done.

- If not, I propose tho add an 'if clause' in the framework to the findprocess method of the clistobjeditform.


...

IF TYPE('ThisForm.oBizObj') = "O"

IF NOT ThisForm.oBizObj.lPrimaryBizObj
ThisForm.SetPrimaryBizObj(ThisForm.oPrimaryBizObj)
ENDIF

*----------------------------------
*--- Requery the business object
*----------------------------------
ThisForm.Requery()


*-------------------------------------------------------------
*--- Restore the original value of ThisForm.nGoToPageOnCancel
*-------------------------------------------------------------
IF lnGoToPageOnCancel != 0
ThisForm.nGoToPageOnCancel = lnGoToPageOnCancel
ENDIF

*-----------------------------------------------------------
*--- If specified to do so, change the form's title
*-----------------------------------------------------------
If ThisForm.lChangeFormTitle
ThisForm.ChangeFormTitle(ThisForm.oBizObj.GetBizObjDesc())
ENDIF


ENDIF
...


Mark.
If everything seems to be going well, you obviously don't know what the hell is going on !
Reply
Map
View

Click here to load this message in the networking platform