Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Temporarily Filter a CursorAdapter
Message
De
10/01/2018 06:11:20
 
 
À
09/01/2018 16:34:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01657053
Message ID:
01657066
Vues:
49
>I don't normally use CursorAdapters but I'm maintaining some code that uses them (actually, instances of the CursorAdapter class). Consider me a CA newbie :)
>
>I have 2 Tables, Referrals and Proponents. One Referral may have one or more Proponents.
>
>Over a period of years, Proponents may become obsolete, so they get marked as "Historical". When this happens, historical Proponents should no longer appear in picklists which allow users to add new Proponent(s) to a Referral. However, the Referral itself should always show all selected Proponents, whether any have subsequently been marked as historical or not.
>
>So far there is 1 CA defined, which shows all Proponents for a given Referral (historical or not). However, at this time the Add New Proponent(s) function uses that same CA, so it's showing all Proponents rather than just those which are not marked Historical.
>
>What I'd like to do is continue to use the same CA but temporarily apply a filter where historical = .F., then remove the filter once the pick form is closed.

2 typical strategies for such a problem: you load/filter/select before each show of the pick list or you create a stable cursor dependant on changes to first cursor. Second case can become hairy if # of dependencies grows, but often offers better "try it" performance as a wait in situations triggering dependancy check is often "natural".

For strategy 2: Used simple array property to store references of CAs to trigger dependant refresh on if only dependant on one cursor and biz classes calculating list of CA to refresh/update in complex cases.

The sledge hammer of strategy 1 is often fast enough - KISS is a solid reason.

>
>Seems to me this could be a common request so it might be built-in to the CA class but I can't find anything that looks promising.
>Is there anything built-in? If not, can anyone offer strategies that would achieve this?
>
>I was thinking maybe just INDEX the cursor FOR historical = .F. but that seems kludgy.

Only kludgy if index is not BINARY
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform