Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Loading data for Page Frames with Grids
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00365936
Message ID:
00366098
Vues:
16
>I have a form that has a PageFrame with 7 pages each with a grid. The dataenvironment for this form consists of 7 views, with each view made up of a single table with the exception of Nameplatv which is made up of Nameplat and Cust tables. Some of the views are : Nameplatv(parent), Dgav(child), Icpv(child), Liquidv(child), etc. In my 7 pages with grids, I want to display records from a single search for each of the grids and their respective views. The search criteria will be CUSTID and UPSINO (which stands for upsi number). Both of these criteria exist in all views and tables. Some searches may be by CUSTID only. Questions:
>
>1)When and where is the best place to Load the dataenvironment? Do I let all tables and views (total 15 work areas) load on the form's "Load" event. Or do I load views only when used and if so where? For example the user may never even view the ICPV tab during any one session, but when they click on that tab I want the data to be there Fast.
>
>2)Or should I re-think my whole dataenviroment and make only two views (1) NAMEPLATV and (2) AllChildTables, thereby having only two views for the whole dataenvironment?
>
>My goal is to enable the user to lookup a single or group of records then double click on any one record in a grid and display another form containing the details of that record.
>
>Thanks for the suggestions and help
>
>Elgin Rogers Jr
>Epic Solutions

I have the same solution here for a configuration management form I have created. The form allows the user to query configuration management data from only one form. When I started I had to determine when and where to get my data. The form has a page frame with 37 tabs and each tab has a page frame with 4-6 tabs on it. I noticed that when the form was being developed that it was slow in coming up because of all the overhead of the data views to open and the tabs to create on the form. Mostly I opened any and all data I would need in the Load event, but I had to rethink that as it is not logical to open a view on page tab 24 unless the user went to their. So I just open the database in the load event and then in the activate code of the page I checked to see if the view was already present if it was not I opened the view. This cut down on overhead quite a bit, but my form still came up extremely slow due to all the pages being instantiated. So with the universal threads help and Jim Booth's article on delaying instantiation of pages until needed. I modified my form creating a class for every page that did not need to come up unless the user asked for it. The page classes were saved and with the help of a proxy class on each page, that builds the page on the fly from the class saved previously. I was able to speed the form up dramtically.

I have also used the technique of calling the view inside the requery method of a list that would show the data. Thus if the user looked at main data but never asked for child data, then the requery method of a list is not called and that reduced overhead.

Hope this helps.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform