Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to prevent View's parms being loaded at form starts
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00160633
Message ID:
00160692
Views:
17
>I have read these sections. I think I understand what they are explaining. I need the form to startup with a populated grid. The nRequery property = 0, do not auto-requery. Could there be anything else out of place?
>Below are my 1st and last cursors.

Well... if the view for the grid is parameterized, I assume you want to use the parameters to limit the records that are shown in the grid. So, you have to decide what initial value will be put into the view parameters.

So, lets say you have a textbox that will be the parameter for the view... set the view parameter to be the value of the textbox.

For example, lets say, you have customers and you want the grid to be populated, but you don't want all the records. so, you set up a textbox that allows the user to enter the state of the customer.

Then, in your view you can set up a filter like...

customer.state = ?vp_state

Now, in the postinithook of the business object, you create an 1 element array to hold this view parameter name, and tell it you want to value of the combobox to be put in the view parameter during a requery.

So, your code in postinithook might look like...

DIMENSION This.aViewParameters[1, 2]
This.aViewParameters[1,VPARM_NAME] = 'vp_state'
This.aViewParameters[1,VPARM_EXPR] = 'Thisform.txtState'

**************

Now, whenever you do a requery, the framework will automatically place the value in thisform.txtState into vp_state prior to requerying.

*************

So, if you don't want the grid to be empty... populate txtState with some states value. Then, set the nRequery on the bizobj to 3 (that basically says, get data when the form inits the first time)

**************

Does any of this make sense?

BOb
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform