[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Popups using Quick Events and populating a form (OpenInsight Specific) ====
=== At 28 APR 2000 02:22:52PM Andy Becker wrote: ===
{{tag>"OpenInsight Specific"}}
This is a little more detailed than my question on the same subject earlier.
We have a table that contains Territory (which is the key), District, Region, name of region and name of district. On the form, we use an edit box with the dropdown event executing the quick event "Execute a Popup."
When the user selects a territory, using the popup (they can also type in the territory), the chosen territory is placed in the appropriate place. We want to take the region and district that is with the territory and place that information into their respective position on the form so the user does not have to enter that information.
We are trouble with doing this. Are we using the wrong type of box or what? Any ideas?
----
=== At 28 APR 2000 04:10PM Oystein Reigem wrote: ===
Andy,
You asked this question before. I think it was Mike Ruane who replied. He assumed your form was data aware and based on the table you mention (let's call it TERRITORIES). Is it?
Let me rephrase: What happens after the user has filled in all the fields in the form ? Does he do a File | Save Row? If so - are the data written to the TERRITORIES table? Or to a different table?
If it's saved to the TERRITORIES table, Mike assumed correctly and his suggestion is valid. You first bring up the popup. Then you take the value returned - a TERRITORY key - and put it in the key edit control of the form. Then you make the form do a READ, which will cause the other fields (DISTRICT, REGION, etc) to be automatically filled in. But you cannot do this with a simple quickevent. You must do a little bit of programming - either with a user event (script), or a stored procedure that you call with a quickevent.
But if the form is based on a different table, or not based on a table, you must instead use the TERRITORY key you got from the popup and read a record from the TERRITORIES table. Then you must pick the values of the various fields (DISTRICT, REGION, etc) from the record and put them into the appropriate edit controls of the form. But exactly as in the first case you need to do a little bit of programming.
I can show you the programming when you tell me which case you've got.
One more thing - you mention the DROPDOWN event of an edit box. Combo boxes got DROPDOWN - not edit boxes. But I'm not sure what you'd want a combo box for.
- Oystein -
----
=== At 01 MAY 2000 11:02AM Andy Becker wrote: ===
Oystein:
We are collecting input for a report. The user can enter either Territory and/or Region and/or District and/or Type.
The form looks a little like this
Enter the Territory COMBO BOX with dropdown for territory table
Enter the District COMBO BOX with dropdown for district table
Enter the Region COMBO BOX with dropdown for region table
Enter the Type COMBO BOX with dropdown for type of dispenser
OK Button CLEAR Button CANCEL Button
(The territory dropdown as well as the dropdowns for the district and regions are maintained by another system.)
If the user chooses Territory (we use a Combo Box not an Edit box like I originally stated), using a Quick Event Popup we dropdown the territory table which also contains the Region and District. The user selects the territory they wish. When a territory is selected we wish to automatically pickup the region and district from this table and use that information rather than have the user enter them. (This will also prevent the user from accidently entering the wrong region/district for the territory.) If the user does not use the dropdown, they can manually enter the territory in which case we will do nothing with the region/district.
When the user clicks OK we use the information the user has entered and build a list statement with break-on and by statements for the report.
There is no save, etc., for the form/table. The district and region input area on the form and have their own popup tables, should the user only want a district and/or region report. These tables only include the district number and name, the region table contains only the region number and name.
I hope this clears up the confusion I have caused.
Any help would be appreciated.
----
=== At 02 MAY 2000 04:47AM Oystein Reigem wrote: ===
Andy,
I'm still confused.
You have some data related to geographical areas. And you want the users to be able to list or print all data related to a certain geographical area. Is that correct?
Furthermore your app has a set of tables that knows about all relevant geographical areas. I assume the areas constitute a hierarchy, e.g with Regions containing Districts. Could you supply some more information about the structure and the various fields?
Let me ask a really silly question: You say the Territory Combo Box has a popup. What is the purpose of that popup? You say the user can select a territory from the popup. But doesn't the combo box already show all the territories? Can't the user just select directly from the combo?
Btw - have the Region and District combos got popups too? Is that what you said?
Here's something one can do when presenting hierarchichal options to the user. I here assume that Regions are the top level of the hierarchy and contain Districts:
- In the CREATE handler get from the relevant table(s) all the Regions, make them into a list and set the LIST property of the Region Combo
- Then the user can first select a Region in the Region Combo
- In the Region Combo CHANGED handler get from the relevant table(s) all the Districts of that Region, make them into a list and set the LIST property of the District Combo
- Then the user can select a District in the District Combo.
This is similar to what the System Editor Open Record dialog does with tables and rows.
Here's another silly question: If you really want your popup(s) - what do you need the combo boxes for? Hasn't (haven't) the popup(s) got the selection functionality the users need?
- Oystein -
Øystein Reigem,
Humanities Information Technologies,
Allégt 27,
N-5007 Bergen,
Norway.
Tel: +47 55 58 32 42.
Fax: +47 55 58 94 70.
oystein.reigem@hit.uib.no
Home tel/fax: +47 56 14 06 11.
[img]http://www.hit.uib.no/oystein/g-anim.gif[/img]
----
=== At 02 MAY 2000 04:50AM Oystein Reigem wrote: ===
My last paragraph should read:
Here's another silly question: If you really want your popup(s) - what do you need the combo boxes for? Hasn't (haven't) the popup(s) got the selection functionality the users need? [i]Can't you replace your combo boxes with simple edit lines?[/i]
- Oystein -
----
=== At 02 MAY 2000 03:55PM Andy Becker wrote: ===
Hi Oystein
Hopefully the following will answer your questions/comments:
Question: You have some data related to geographical areas. And you want the users to be able to list or print all data related to a certain geographical area. Is that correct?
Answer: Yes, Region is at the top, followed by District, then Territory.
Question: Furthermore your app has a set of tables that knows about all relevant geographical areas. I assume the areas constitute a hierarchy, e.g with Regions containing Districts. Could you supply some more information about the structure and the various fields?
Answer: We created 3 separate tables for future use by various other applications that we will be developing, in addition to the table and form for the dispenser type.
Region Table ? contains only the region number and the city name for that region. The Lottery has 5 regions in the state of Illinois (the only thing that the Illinois State Lottery is concerned with.) 1 ? Westchester, 2 ? Lombard, 3 ? Rockford, 4 ? Cahokia, 5 ? Bloomington.
District Table ? contains only the district number and city name for that district. The Lottery has 9 districts ? 1 ? the northern area of Chicago, 2 ? Lombard, 3 ? the South area of Chicago, 4 ? Rockford, 5 ? Rock Island, 6 ? Bloomington, 7 ? The Central area of Chicago, 8 ? Cahokia, 9 ? Mt. Vernon.
Territory Table ? contains all the territories in the state (66 total). Contains the following:
Territory number, District number, Region number, symbolic District Name (from District table) and symbolic Region Name (from Region Table). The territories can be reassigned by Marketing from one district to another or from region to another at any time. Example: Territory 009 is in District 1, Region 1 today. Tomorrow Marketing may decide that Territory 9 is moving to District 2, Region 2.
Dispenser Type Table ? contains the code and description for all dispensers.
Main Table - in this application this table contains an agent number, symbolic fields going to the master agent file which contain region, district and territory and information on the in-counter dispensers that the agent (the Lottery retailer seller) has in his business. Each dispenser has a code and there are six dispenser types.
Question: Btw - have the Region and District combos got popups too? Is that what you said?
Answer: Yes, the region, district and type are combo boxes, each popping up the appropriate file. If the user wishes all territories for a given district, they leave the territory, region and type boxes empty and either type in the district or popup the table and select from there. There are times when the boss will ask for Bloomington and the user doesn?t know which district Bloomington happens to be. They click on the popup and the number and its associated city is right in front of them.
The Report Gathering Form ? Using combo boxes we have the user enter any option they wish. They can enter Region only or District only or Territory only or the type code only or any combination of them. We use the combo boxes for the following reasons, however, if there is a way to do the same thing easier, please let me know.
1. The combo box has the ability to popup (dropdown) a table using the quick event popup.
2. The combo box has a down arrow indicating that there is something that the user can click on to obtain information.
3. We didn?t know any other way of doing this.
What we wish to do is when the user selects a territory from the popup, we wish to flood, he Report Gathering controls, the region and district that is associated with that territory. In this manner, the user will not need to type in the two items (we eliminate the user entering the wrong region/district due to changes they may not be aware of) or selecting the region and/or district from the popup. (The Territory table is the only table that has all three items.)
As for the List, I believe I have misled you. It is actually an or_view statement that is built with the information supplied by the user via the Report Gathering Form. MEA CULPA (Latin ? My Fault).
Hopefully this will give you the information you need and hope I haven?t confused you even more.
----
=== At 03 MAY 2000 06:30AM Oy wrote: ===
Andy,
[i]Question: You have some data related to geographical areas. And you want the users to be able to list or print all data related to a certain geographical area. Is that correct?
Answer: Yes, Region is at the top, followed by District, then Territory.[/i]
So it's a hierarchy.
[i]Question: Furthermore your app has a set of tables that knows about all relevant geographical areas. I assume the areas constitute a hierarchy, e.g with Regions containing Districts. Could you supply some more information about the structure and the various fields?
Answer: We created 3 separate tables for future use by various other applications that we will be developing, in addition to the table and form for the dispenser type.[/i]
[i]Region Table ? contains only the region number and the city name for that region. ...[/i]
OK.
[i]... The Lottery has 5 regions in the state of Illinois (the only thing that the Illinois State Lottery is concerned with.) 1 ? Westchester, 2 ? Lombard, 3 ? Rockford, 4 ? Cahokia, 5 ? Bloomington.[/i]
OK.
[i]District Table ? contains only the district number and city name for that district. ...[/i]
Shouldn't it also contain a key to the Region table - the Region number of the containing region? How else does the system know which regions contain which districts?
[i]... The Lottery has 9 districts ? 1 ? the northern area of Chicago, 2 ? Lombard, 3 ? the South area of Chicago, 4 ? Rockford, 5 ? Rock Island, 6 ? Bloomington, 7 ? The Central area of Chicago, 8 ? Cahokia, 9 ? Mt. Vernon.[/i]
Doesn't look like much of an hierarchy to me, with almost all the Regions being Districts too.
But for the sake of discussion I will still assume there is a proper hierarchy, where each area contains several sub-areas.
[i]Territory Table ? contains all the territories in the state (66 total). Contains the following:
Territory number, District number, Region number, symbolic District Name (from District table) and symbolic Region Name (from Region Table). The territories can be reassigned by Marketing ...[/i]
Aha! Here's that Region number I just asked about. But the logical thing would be to have the Region number in the District table. Then each territory (each Territory row) knows which district it belongs to, and each district (each District row) which region it belongs to.
[i]The Report Gathering Form ? Using combo boxes we have the user enter any option they wish. They can enter Region only or District only or Territory only or the type code only or any combination of them. We use the combo boxes for the following reasons, however, if there is a way to do the same thing easier, please let me know.[/i]
See below.
[i]1. The combo box has the ability to popup (dropdown) a table using the quick event popup.[/i]
Automatically? Without any programming? Didn't know that. On the DROPDOWN event?
Anyway - that clears up my confusion about the popup. I thought you had a real popup in addition to the combo boxes.
[i]2. The combo box has a down arrow indicating that there is something that the user can click on to obtain information.[/i]
OK.
[i]3. We didn?t know any other way of doing this.[/i]
One thing I haven't asked earlier is why you allow the user to be able to key in his own values. Aren't the Region, District and Territory tables exhaustive?
If they are, you don't need the combo box's ability to accept user values. You could use list boxes, and thereby make sure the user will always select legal values for each of the fields. Agree?
Then there's the hierarchical relation between the three fields. If you use three separate controls I think you should have some programming that makes sure their content and selected values are consistent, or the user may end up searching for unwanted or impossible combinations. E.g, if the user first selects a Territory, and then changes his mind and selects a whole Region instead, the proper thing for the form to do would be to deselect the territory in the Territory combo, because that selection isn't valid any more. Agree? Also it should update the District combo so it shows the names for just the districts in that region (but not select any of them), preparing for the possibility of the user narrowing in on district, and making sure the user cannot go on and select a District that is not in the Region. Agree?
But what I'd do myself (unless user values must be allowed) is to have all the information in an hierarchical list box. Here's an example with some other data:
- Animals
- - Cats
- - - Burmese
- - - Siamese
- - Dogs
- - - Poodles
- - - Whippets
- Plants
- - Trees
- - - Birches
- - - Oaks
- - - Pines
As you can see all the relevant information (geographical in your case) is presented to the user in a clear and systematic way.
[i]What we wish to do is when the user selects a territory from the popup, we wish to flood, he Report Gathering controls, the region and district that is associated with that territory. In this manner, the user will not need to type in the two items (we eliminate the user entering the wrong region/district due to changes they may not be aware of) or selecting the region and/or district from the popup. (The Territory table is the only table that has all three items.)[/i]
Bonus question: Why do you need the Region and District filled in? What is the real reason? Territory should be enough for doing a search - Region and District are superfluous.
[i]As for the List, I believe I have misled you. It is actually an or_view statement that is built with the information supplied by the user via the Report Gathering Form. MEA CULPA (Latin ? My Fault).
Hopefully this will give you the information you need and hope I haven?t confused you even more.[/i]
Confusion still reigns. Abyssus abyssum invocat. :-) :-) :-)
- Oystein -
----
=== At 05 MAY 2000 02:42PM Andy Becker wrote: ===
Oystein:
We (myself and the two guys that work with me) roughly translate Abyssus abyssum invocat as the blind leading the blind. Close enough?
We have a solution. It works, may not be the best, but hey - it works.
We defined the Territory Combo box as a drop down and the data base association we put the territory table with the column territory. We put a quick event on the dropdown to display the territory table with the control @SELF and property TEXT.
We defined the District Combo box the same except we associated the district from the territory table. We also put a quick event on the dropdown to display the district table with the control @SELF and property TEXT. This allows the user to select district without selecting a territory.
We defined the Region Combo box the same except we associated the region from the territory table. We also put a quick event on the dropdown to display the region table with the control @SELF and property TEXT. This allows the user to select region without selecting a territory and/or district.
When the user selects the territory from the dropdown territory table, upon leaving that position, the region and district is "plugged" into the respective boxes which was our orginal goal. Works quite well.
Thanks for all your help and if we ever meet, I'll try and explain just what we are doing.
Good luck from the boys from Illinois Lottery. Thanks, thanks, thanks.
----
=== At 05 MAY 2000 05:57PM Oystein Reigem wrote: ===
Andy,
Glad to hear it's working out.
About that Abyssum phrase: I think the literal translation is "the abyss speaks to the abyss", or "the abyss calls the abyss". I heard it in a film once and it stuck in my mind. I thought it sounded very impressive. But what it really means? No idea. At least it cannot be a very fruitful conversation. What I was thinking of was the way we seemed to confuse each other.
Aaargh! Evil you! Now I suddenly need to know what it really means! (Searching the Web with Alta Vista...) According to one source the English translation is "Seo neolnes cliopað to
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=263EE0C23E02606F852568CF0064F896|View this thread on the forum...]]