Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CodeMine Toolbar Requery button
Message
From
16/09/2002 18:41:56
 
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00701003
Message ID:
00701024
Views:
23
Hi Mel:

>I have a simple form that is using a view (its a very small table, so I am not using a parameterized view). I would like to have that Requery button on the Toolbar enabled for this view, so the view can be requeried with a press. Can someone tell me the best way to do this with CodeMine 7.

This button requires two things to be present :-

1. A value in form.cWorkarea
2. A value in form.cRequeryDialogClass

This button is there to allow you to call a specified requery dialog class. This dialog allows you to specify fields that are linked to the view's parameters. It effectively creates a set of private variables named after the view parameters and then requeries the views from the dialog whilst the private variables are in scope.

This mechanism will not be effective if your view is not parameterised. However, to override this behaviour, go to our old friend, the forms "IsEnabled" method and subclass the "requery" branch of the methods do case structure. You could simply put code in your subclass like so :-
do case
    case m.cMethod == 'Requery'
        return .T.
In the form's Requery method, subclass it and add code like this :-
thisform.cmDataManager.Requery('ViewName')
*-- Dont call DoDefault() - you don't want the form's native query behaviour.
If you look at IsEnabled for the original Requery criteria and the form's Requery method, you will get an idea of how this hangs together. This type of view behaviour had its roots in Codemine 6 and earlier. This, IMHO, is not the way to handle views in Codemine 7 as view enjoy far superior support in the new CDE.

HTH
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform