1 2 Previous Next 15 Replies Latest reply on Apr 16, 2009 3:05 AM by pib_1

    Creating a vertical Menu

    dinora

      Title

      Creating a vertical Menu

      Post

      I want to be able to display a menu on my layout which lets say displays all countries by name -  If you move up or down the menu (which I assume is a portal) then the right side of the screen displays details of  the record highlighted - In my case details of he country such as country code, area code, currency etc.

       

      Then on the top maybe a dropdown to filter all countries, active countries, inactive countries.

       

      If you are familiar with Quickbooks, I am looking to make something similar to the customer dashboard.

       

      Can anyone help??

       

      Thanks

       

      Dinora

        • 1. Re: Creating a vertical Menu
          philmodjunk
            

          Dinora,

           

          I see your database is gradually growing in sophistication :smileywink:

           

          You need a portal that can be used as a "click list". Clicking the list selects a specific country so that the user can view detailed information on that country.

           

          Let's put your portal on the layout first:

           

          Define a global text field called "gCategory" in your Country table.

          Define a text field in this table called "Category".

          Enter your Category information for this field. (Active, Inactive, etc.)

          Press the return key and enter "All" in the same field.

          Thus an active country will show

             Active

             All

           

          and an Inactive country will show

            Inactive

            All

           

          Define a self join relationship linking gCategory to Category. This will create a new Table Instance (I called this a Table Occurrence in earlier threads).

          Name it CountryList. Specify a sort order in the CountryList side of the relationship, if you want to see the countries in your portal listed in a specific order.

           

          Place a portal on your layout and choose CountryList for its table.

          Put the CountryList::Country Name field in the portal.

          Place gCategory on your layout just above the portal.

          Format it to display the values All, Inactive, Active as a drop down list, pop up menu and or radio buttons.

          Enter browse mode and try it out.

          You should be able to see a list of either all countries, inactive countries or active countries by selecting the matching value in gCountry.

           

          You're almost done.

          Write a script that will be performed when a user clicks a country name in the portal:

           

          Set Variable $Cntry, CountryList::Country Name     (or country ID code or any other field that uniquely identifies on country record.)

          Enter Find Mode []

          Set Field [Country::Country Name, $Cntry] (Instead of country, use the name of table assigned to the layout where you put the portal, DON'T refer to the Portal's Table Instance.

          Perform Find.

           

          One last step:

          Enter layout mode, Right Click the Country Name field in the portal and choose Button Setup.

          Select the script we just created as the script for this field/button.

           

          Return to Browse mode and try it out.

          • 2. Re: Creating a vertical Menu
            dinora
              

            Hi Phil,

             

            Thank you for your answer -  A few questions - I am confused remember I am an amateur on this

             

            1.- I define a gCategory by just selecting global from the options under storage - Correct?

             

            2.- You say the following, - Dinora asks what do you mean by this where do I enter this category information on a value list? Custom values?

            Or is this a long text field where I enter each value separated by a carriage return? Please explain


            Define a text field in this table called "Category".

            Enter your Category information for this field. (Active, Inactive, etc.)

            Press the return key and enter "All" in the same field.

            Thus an active country will show

               Active

               All

             

            and an Inactive country will show

              Inactive

              All


            And then my last question on the script -  CAn I apply the script trigger to the actual field on the portal so that as I am moving the cursor from one portal record to the next then it displays automatically the information related to the portal record.

             

            i.e. If Argentina is selected the right side of my screen displays argentina info -then if I move to the next portal record and is for Algeria - Algeria info displays automatically without having to perform a find??

             

            Thanks

            Dinora

            • 3. Re: Creating a vertical Menu
              philmodjunk
                

              Dinora,

               

              You're making good progress and we'll get you to expert status yet :smileywink:

               

              1.- I define a gCategory by just selecting global from the options under storage - Correct?

              You are correct. Using a global field keeps the same options for your portal as you move from record to record.

               

              2.- You say the following, - Dinora asks what do you mean by this where do I enter this category information on a value list? Custom values?

              Or is this a long text field where I enter each value separated by a carriage return? Please explain

              This is a long text field where you type in values separated by carriage returns. There are other options depending on what you currently have in your tables. I've kept to the simplest method to get you started.

               

              And then my last question on the script -  CAn I apply the script trigger to the actual field on the portal so that as I am moving the cursor from one portal record to the next then it displays automatically the information related to the portal record.

               

              i.e. If Argentina is selected the right side of my screen displays argentina info -then if I move to the next portal record and is for Algeria - Algeria info displays automatically without having to perform a find??

               

              Yes you could, but am not sure you should. If the user can enter the field, you will need to take steps to protect your country names from being accidently modified by the user. Here's what I mean: the user enters the field and a script trigger excutes the script I described earlier for picking a country. Then the user leans on the a key and Argentina becomes aaaaaaaaaaaaaaaaArgentina. You can prevent this by not allowing user modification (a validation option on the field) or by defining a calculation field that returns the Country's name. Then you place this calc field in your portal instead of a text field.

               

              Both options trigger error messages if a user accidently attempts to modify the field. My preference is to have the user click the fields, but it's your design, if you can make a script trigger work for you and you like the results, go for it! :smileytongue:

               

              • 4. Re: Creating a vertical Menu
                dinora
                  

                No I am still not getting it. 

                 

                I have the gcategory - I have the category field  all created

                My relationship goes from Country list::gcategory---------<category::country table

                 

                I have created a portal and it displays all the countries in the country table

                Problem I am having is with the script -  Is not working -  So can you confirm if I have established the right relationship?

                 

                 

                 

                 

                 

                • 5. Re: Creating a vertical Menu
                  dinora
                    

                  Hi Phil

                   

                  I got it -  I am displaying the countries on the portal and as click through each then I see the information displayed on the right side of the screen

                   

                  The second part of my original question - I am still having problems

                  On my country table I have a field (radio button) to indicate whether a country is active or not

                   

                  You have asked me the create a category (text field) and enter active, inactive, all etc.  My question is how is this text field being linked to the active Yes/No button field in order to display

                   

                  Currently I am completely lost on this one as I cannot see the logic

                   

                  Sorry

                   

                  The first part though portal and script are all working !!

                   

                  Can you help one more time

                   

                  • 6. Re: Creating a vertical Menu
                    obeechi
                      

                    Regarding the following:  

                      Define a global text field called "gCategory" in your Country table.

                      Define a text field in this table called "Category".

                      Enter your Category information for this field. (Active, Inactive, etc.)

                      Press the return key and enter "All" in the same field.

                      Thus an active country will show

                         Active

                         All

                     

                      and an Inactive country will show

                        Inactive

                        All

                     

                    Seems that ( from what I recall ) it would be better to have a relationship between gCategory and cCategory, where cCategory is a calculated field that references tCategory, where g is global, c is calculation field, t is text field, and where all three fields are in the same table. So the user would click into tCategory on the layout, and this would call or cause a drop down value list ( because the layout field is set to drop down list ), where the value list is comprised of two custom values ( Active, Inactive ), and the user would select either Active or Inactive, and the cCategory field would be defined as "All" & Pilcrow & Category, where "All" is a string in your calculation, Pilcrow is inserted by you in the calculation to indicate a carriage return ( i.e. /n ) , and Category is simply the field ( also inserted by you ( or typed ) into the calculation. ) 

                     

                    Then, as an intermediate test, you go to your layout in browse mode and type the word All in your gCategory field. Look and see what the portal displays. Next replace the word All with the word Active. If none of the records have a value of Active placed in their field Category, then you shouldn't see anything. If at least one record has the value Active placed in the field Category, then you will see that one record in the view in the portal, et. Likewise for "Inactive'.

                     

                    Now to develop it further, create a value list that will be used by the gCategory field, so the user will click into the gCategory field and a value list will drop down consisting of the choices All, Active, Inactive. This will allow you to filter what is viewable in the portal. If the gCategory field is set to Active, and then the user changes the value of Category for a given record from Active to Inactive, then the same record will not be viewable in the portal. There must be a match between what is in gCategory and what is in cCategory, note that cCategory is  essential a list of delimited values, in other words the field is like a value list made up of the words Active and Inactive. When there is a relationship between a like-value-list field and another field, then only one member of the like-value-list field has to match the "other" field. If no members match, then there is no related record for that given record. You'll want to restrict what users can enter into gCategory and Category, since Active and Atcive don't match

                    • 7. Re: Creating a vertical Menu
                      philmodjunk
                        

                      The second part of my original question - I am still having problems

                      On my country table I have a field (radio button) to indicate whether a country is active or not

                       

                      You have asked me the create a category (text field) and enter active, inactive, all etc.  My question is how is this text field being linked to the active Yes/No button field in order to display

                       

                      Currently I am completely lost on this one as I cannot see the logic

                       


                      We're getting there. Not knowing how you were recording status, I kept to the simplest example of the technique. As you've observed, now you need a way to update the text field everytime the country record's status changes as currently there is no link between the fields.

                       

                      Change the simple text field to a calculation that returns text.

                       

                      I'm assuming your radio button field, "Status", contains the text "active" or "inactive". Your radio buttons will enter whatever text you defined as a value in the radio button value list.

                       

                      Define category as Country::Status & "<P>" & "All"

                       

                      In place of <P>, enter the paragraph symbol. (That's the button that looks a little like "P" just above the () operator button.)

                       

                      Now your Multivalue key will automatically update whenever the status is changed.

                       

                      If your radio buttons are []Yes []No, then use an if statement to translate Yes/No into Active/Inactive. If(Country::Status = "Yes";"Active" ; "Inactive" ) & "<P>" & "All

                      • 8. Re: Creating a vertical Menu
                        dinora
                          

                        Can I have two global fields one for Active/Inactive and one for Alphabet -  Each one goes to the same TO but one links to the regular alphabet field while the other one links the category -

                         

                        The idea is now that I have a menu with all the letters of the alphabet I still want to see my countries by active or inactive. ?

                         

                        Can this be done without having to create a third TO?

                        • 9. Re: Creating a vertical Menu
                          philmodjunk
                            

                          Dinora wrote:

                          Can I have two global fields one for Active/Inactive and one for Alphabet -  Each one goes to the same TO but one links to the regular alphabet field while the other one links the category -

                           

                          The idea is now that I have a menu with all the letters of the alphabet I still want to see my countries by active or inactive. ?

                           

                          Can this be done without having to create a third TO?


                           

                          I hear you. Yes you can have two globals. No you won't need another TO. I had to check that out just to be sure before I answered you.

                           

                          When you create relationships between tables, you can refer to more than one pair of fields linking your two tables.

                           

                          1. Define your second Global Text field: gLetter
                          2. Open the Relationships Graph
                          3. Double click the line linking your tables.
                          4. Select the same multi-value text field
                          5. Select gLetter as the matching field in the other table.
                          6. Click Add
                          7. Click OK

                           

                          Now you can set up Your Global field for selecting a letter of the alphabet and a second global field for Active/Inactive status.

                          Selecting 'C' from the first field and "Active" from the second field should filter your portal to just those countries who are active and whose names start with the letter C.


                          • 10. Re: Creating a vertical Menu
                            dinora
                              

                            Hi Phil

                             

                            I am having problems with this solution

                             


                            I hear you. Yes you can have two globals. No you won't need another TO. I had to check that out just to be sure before I answered you.

                             

                            When you create relationships between tables, you can refer to more than one pair of fields linking your two tables.

                             

                            1. Define your second Global Text field: gLetter
                            2. Open the Relationships Graph
                            3. Double click the line linking your tables.
                            4. Select the same multi-value text field
                            5. Select gLetter as the matching field in the other table.
                            6. Click Add
                            7. Click OK

                             

                            Now you can set up Your Global field for selecting a letter of the alphabet and a second global field for Active/Inactive status.

                            Selecting 'C' from the first field and "Active" from the second field should filter your portal to just those countries who are active and whose names start with the letter C.


                            I have a table which contains the names of tours that exist in each city so I want a menu to sort out tours by city and by alphabet

                             

                            I have created two global fields

                            galphabet

                            gcity

                             

                            I have also created two calculation fields

                            alphabeta_z

                            citiesa_z

                             

                            Calculation for the first one is

                            left(tour_name;1)

                             

                            Calculation for the second one  = city name

                             

                            Your solution tells me to use one parent table then create two self joining relations which will generate a TO

                             

                            So in effect my relation is

                             

                            Tours Table (Parent)        Tours Table (TO)

                            galphabet=alphabet a_z and

                            gcities= citiesa_z

                             

                            Is this correct?

                             

                            If so then I will have to create the portal from the TO and indicate to display tour names on the portal again from the TO

                             

                            Which field do I use to create the the drop down search galphabet or gcities or is it just one how to they both work

                             

                            My end result

                            I want to select a city from the drop down and the city should display the tours available and from there I want to select alphabet letter and the list within this port will jump to first letter of the alphabet as selected?

                            • 11. Re: Creating a vertical Menu
                              philmodjunk
                                

                              Dinora Writes:

                              I have created two global fields

                              galphabet

                              gcity

                               

                              I have also created two calculation fields

                              alphabeta_z

                              citiesa_z

                               

                              Calculation for the first one is

                              left(tour_name;1)

                               

                              Calculation for the second one  = city name

                               

                              Your solution tells me to use one parent table then create two self joining relations which will generate a TO

                               

                              So in effect my relation is

                               

                              Tours Table (Parent)        Tours Table (TO)

                              galphabet=alphabet a_z and

                              gcities= citiesa_z

                               

                              Is this correct?

                              Open Manage | Database | Relationships

                              Double click the = joining the Parent table with the second TO.

                              You should see:

                                      galphabet = Alphabet a_z

                              AND  gcities = citiesa_z

                               

                              appear in the relationship dialog that opens up.

                              If so, then yes, you have it set it up correctly.

                               

                              Place gcities and galphabet on your layout. I'd place them just above the portal they control, but that's just my preference.

                              Format gcities as a drop down list that displays your cities.

                              Format galphabet to list the letters a through z  and you should now be able to see the contents of the portal change when you select different values from your two fields.

                              • 12. Re: Creating a vertical Menu
                                pib_1
                                  

                                Hello

                                Would it be possible to have a real example of the vertical menu. Maybe through a link or so.

                                Thank you very much in advance

                                Regards to all

                                pib \o/

                                • 13. Re: Creating a vertical Menu
                                  dinora
                                    

                                  Hi Pib

                                   

                                  I do not know a way to show you a real example through a link? 

                                  But I can tell you that the solution offered on this thread by Phil works. 

                                   

                                  • 14. Re: Creating a vertical Menu
                                    dinora
                                      

                                    Yes I got it now!

                                    Thanks

                                    1 2 Previous Next